mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 13:26:39 +03:00
0.971
+ added color coding of backpack when selling fixes #112 + fixed silver to gold conversion rates on bulk selling weapons and backpacks. Fixes #114 + add more missing weights for R3F realism. Fixes #110 + added random direction to purchased vehicles makes it harder to get duplicate uid not fixed 100%
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
private["_location","_isOk","_dir","_classname","_item"];
|
||||
_location = player modeltoworld [0,1,0];
|
||||
_location set [2,0];
|
||||
// _location set [2,0];
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_isWater = (surfaceIsWater _location) or dayz_isSwimming;
|
||||
_bypass = false;
|
||||
|
||||
@@ -91,7 +91,15 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
|
||||
|
||||
_count = 0;
|
||||
if(_type == "CfgVehicles") then {
|
||||
_count = {(typeOf _x) == _name} count (nearestObjects [player, [_name], 10]);
|
||||
if (_afile == "trade_backpacks") then {
|
||||
_bag = unitBackpack player;
|
||||
_bagclass = typeOf _bag;
|
||||
if(_name == _bagclass) then {
|
||||
_count = 1;
|
||||
};
|
||||
} else {
|
||||
_count = {(typeOf _x) == _name} count (nearestObjects [player, [_name], 10]);
|
||||
}
|
||||
};
|
||||
if(_type == "CfgMagazines") then {
|
||||
_count = {_x == _name} count magazines player;
|
||||
|
||||
@@ -44,10 +44,10 @@ if (_qty >= _qty_in) then {
|
||||
player removeMagazine _part_in;
|
||||
};
|
||||
|
||||
_dir = 90;
|
||||
_dir = round(random 180);
|
||||
|
||||
|
||||
_helipad = nearestObjects [player, ["HeliHCivil"], 200];
|
||||
_helipad = nearestObjects [player, ["HeliHCivil"], 50];
|
||||
if(count _helipad > 0) then {
|
||||
_location = (getPosATL (_helipad select 0));
|
||||
} else {
|
||||
|
||||
@@ -62,40 +62,35 @@ if (_bulkqty >= 1) then {
|
||||
// gold = 6 silver
|
||||
//
|
||||
|
||||
if (_part_out == "ItemSilverBar") then {
|
||||
if (_part_out == "ItemSilverBar" and _qty_out >= 30) then {
|
||||
|
||||
if (_qty_out >= 6) then {
|
||||
|
||||
|
||||
// find number of gold
|
||||
_gold_out = _qty_out / 6;
|
||||
// find number of gold
|
||||
_gold_out = _qty_out / 30;
|
||||
|
||||
// whole number of gold bars
|
||||
_gold_qty_out = floor _gold_out;
|
||||
// whole number of gold bars
|
||||
_gold_qty_out = floor _gold_out;
|
||||
|
||||
_part_out = "ItemGoldBar";
|
||||
for "_x" from 1 to _gold_qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
// Find remainder
|
||||
_partial_qty_out = (_gold_out - _gold_qty_out) * 6;
|
||||
|
||||
// whole number of gold bars
|
||||
_silver_qty_out = floor _partial_qty_out;
|
||||
|
||||
_part_out = "ItemSilverBar";
|
||||
for "_x" from 1 to _silver_qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
for "_x" from 1 to _qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
_part_out = "ItemGoldBar";
|
||||
for "_x" from 1 to _gold_qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
// Find remainder
|
||||
_partial_qty_out = (_gold_out - _gold_qty_out) * 30;
|
||||
|
||||
// whole number of silver bars
|
||||
_silver_qty_out = floor _partial_qty_out;
|
||||
|
||||
_part_out = "ItemSilverBar";
|
||||
for "_x" from 1 to _silver_qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
for "_x" from 1 to _qty_out do {
|
||||
|
||||
@@ -58,40 +58,35 @@ if (_bulkqty >= 1) then {
|
||||
// gold = 6 silver
|
||||
//
|
||||
|
||||
if (_part_out == "ItemSilverBar") then {
|
||||
if (_part_out == "ItemSilverBar" and _qty_out >= 30) then {
|
||||
|
||||
if (_qty_out >= 6) then {
|
||||
|
||||
|
||||
// find number of gold
|
||||
_gold_out = _qty_out / 6;
|
||||
// find number of gold
|
||||
_gold_out = _qty_out / 30;
|
||||
|
||||
// whole number of gold bars
|
||||
_gold_qty_out = floor _gold_out;
|
||||
// whole number of gold bars
|
||||
_gold_qty_out = floor _gold_out;
|
||||
|
||||
_part_out = "ItemGoldBar";
|
||||
for "_x" from 1 to _gold_qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
// Find remainder
|
||||
_partial_qty_out = (_gold_out - _gold_qty_out) * 6;
|
||||
|
||||
// whole number of gold bars
|
||||
_silver_qty_out = floor _partial_qty_out;
|
||||
|
||||
_part_out = "ItemSilverBar";
|
||||
for "_x" from 1 to _silver_qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
for "_x" from 1 to _qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
_part_out = "ItemGoldBar";
|
||||
for "_x" from 1 to _gold_qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
// Find remainder
|
||||
_partial_qty_out = (_gold_out - _gold_qty_out) * 30;
|
||||
|
||||
// whole number of silver bars
|
||||
_silver_qty_out = floor _partial_qty_out;
|
||||
|
||||
_part_out = "ItemSilverBar";
|
||||
for "_x" from 1 to _silver_qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
for "_x" from 1 to _qty_out do {
|
||||
|
||||
@@ -76,8 +76,6 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 6))
|
||||
_canmove = canmove cursorTarget;
|
||||
_text = getText (configFile >> "CfgVehicles" >> typeOf cursorTarget >> "displayName");
|
||||
|
||||
|
||||
|
||||
_rawmeat = meatraw;
|
||||
_hasRawMeat = false;
|
||||
{
|
||||
|
||||
@@ -102,11 +102,11 @@ if (_nearbyCount < 1) exitwith {};
|
||||
if ((time - dayz_spawnWait) > dayz_spawnDelay) then {
|
||||
if (dayz_spawnZombies < _maxZombies) then {
|
||||
if (_spawnZombies) then {
|
||||
hintSilent format["Spawning %1 / %2 <br /> total: %3 ",dayz_spawnZombies,_maxZombies,count (_position nearEntities ["zZombie_Base",_radius+100])];
|
||||
//hintSilent format["Spawning %1 / %2 <br /> total: %3 ",dayz_spawnZombies,_maxZombies,count (_position nearEntities ["zZombie_Base",_radius+100])];
|
||||
[_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _maxZombies] call player_spawnzedCheck;
|
||||
};
|
||||
} else {
|
||||
hintSilent format["Waiting %1 / %2 <br /> total: %3",dayz_spawnZombies,_maxZombies,count (_position nearEntities ["zZombie_Base",_radius+100])];
|
||||
//hintSilent format["Waiting %1 / %2 <br /> total: %3",dayz_spawnZombies,_maxZombies,count (_position nearEntities ["zZombie_Base",_radius+100])];
|
||||
dayz_spawnWait = time;
|
||||
dayz_spawnZombies = 0;
|
||||
};
|
||||
|
||||
@@ -27,10 +27,12 @@ if (_doLoiter) then {
|
||||
//diag_log ("Spawned: " + str([_type, _position, [], _radius, _method]));
|
||||
_agent = createAgent [_type, _position, [], _radius, _method];
|
||||
|
||||
/*
|
||||
if(!(_agent == objNull)) then {
|
||||
dayzSpawnZed = [_agent];
|
||||
publicVariableServer "dayzSpawnZed";
|
||||
};
|
||||
*/
|
||||
|
||||
if (_doLoiter) then {
|
||||
_agent setPosATL _position;
|
||||
|
||||
@@ -27,7 +27,7 @@ class CfgMods
|
||||
{
|
||||
class DayZ
|
||||
{
|
||||
dir = "DayZ";
|
||||
dir = "@DayZ_Epoch";
|
||||
name = "DayZ Epoch";
|
||||
picture = "z\addons\dayz_code\gui\dayz_logo_ca.paa";
|
||||
hidePicture = 0;
|
||||
|
||||
Reference in New Issue
Block a user