Make Sharks Lootable under Water

This commit is contained in:
He-Man 2017-10-12 22:48:32 +02:00
parent 63fc23b8cb
commit ffa4ad32fd
5 changed files with 51 additions and 29 deletions

View File

@ -17,11 +17,15 @@ private ["_items","_magazines","_weapons"];
//[[[end]]]
closeDialog 0;
{
if ((_x getvariable ["EPOCH_Loot",false]) || _x iskindof "container_epoch") then {
_nearplayers = (player nearEntities ["Man", 12]) select {alive _x && isplayer _x && !(_x == player)};
if (count _nearplayers > 0) exitwith {
["Take all not allowed near other Players",5] call Epoch_message;
};
_magazines = magazinesAmmoCargo _x;
clearMagazineCargoGlobal _x;
{
[_x select 0,_x select 1] call EPOCH_fnc_addItemOverflow;
[_x select 0,1] call EPOCH_fnc_addItemOverflow;
} foreach _magazines;
_items = itemCargo _x;
@ -35,5 +39,5 @@ closeDialog 0;
{
_x call EPOCH_fnc_addItemOverflow;
} foreach _weapons;
} foreach nearestObjects[player, ["container_epoch"], 5];
};
} foreach nearestObjects[player, ["container_epoch","weaponholdersimulated","GroundWeaponHolder"], 5];

View File

@ -13,15 +13,30 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_QuickTakeLoad.sqf
*/
//[[[cog import generate_private_arrays ]]]
private ["_index","_magazines"];
private ["_index"];
//[[[end]]]
createDialog "QuickTake";
{
_magazines = magazinesAmmoCargo _x;
if ((_x getvariable ["EPOCH_Loot",false]) || _x iskindof "container_epoch") then {
{
_index = lbAdd[1500, getText(configfile >> "CfgMagazines" >> (_x select 0) >> "DisplayName")];
lbSetData[1500, _index, _x select 0];
lbSetValue[1500, _index, _x select 1];
lbSetPicture[1500, _index, _x select 0 call EPOCH_itemPicture];
} foreach _magazines;
} foreach nearestObjects[player, ["container_epoch"], 5];
} foreach (magazinesAmmoCargo _x);
{
_index = lbAdd[1500, getText(configfile >> "CfgWeapons" >> _x >> "DisplayName")];
lbSetData[1500, _index, _x];
lbSetValue[1500, _index, _x];
lbSetPicture[1500, _index, _x call EPOCH_itemPicture];
} foreach (itemcargo _x);
{
_index = lbAdd[1500, getText(configfile >> "CfgWeapons" >> _x >> "DisplayName")];
lbSetData[1500, _index, _x];
lbSetValue[1500, _index, _x];
lbSetPicture[1500, _index, _x call EPOCH_itemPicture];
} foreach (weaponCargo _x);
};
} foreach (nearestObjects[player, ["container_epoch","weaponholdersimulated","GroundWeaponHolder"], 5]);

View File

@ -30,7 +30,7 @@ class veh_unLock
class player_inspect
{
condition = "!dyna_inVehicle";
action = "call EPOCH_lootTrash;";
action = "if !(underwater player) then {call EPOCH_lootTrash}else {if !(((nearestobjects [player,['container_epoch','weaponholdersimulated','GroundWeaponHolder'],5]) select {(_x getvariable ['EPOCH_Loot',false]) || (_x iskindof 'container_epoch' && _x animationPhase 'open_lid' > 0.5)}) isequalto []) then {call EPOCH_QuickTakeLoad} else {call EPOCH_lootTrash}};";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\player_inspect.paa";
tooltip = "Examine";
};

View File

@ -27,6 +27,9 @@ if !(isNull _object) then {
};
deleteVehicle _object;
_item = createVehicle["groundWeaponHolder", [0,0,0], [], 0.0, "CAN_COLLIDE"];
if (_objectClass isequalto "GreatWhite_F") then {
_item setvariable ["EPOCH_Loot",true,true];
};
_item setPosATL _pos;
_class = "SeaFood";
_config = configFile >> "CfgMainTable" >> _objectClass;

View File

@ -894,7 +894,7 @@ class CfgLootTable
{
items[] = {
{ { "MetalBars", "CfgLootTable" }, 9 },
{ { "ItemBriefcaseGold100oz", "magazine" }, 1 }
{ { "ItemGoldBar", "magazine" }, 2 }
};
};
class Epoch_Sapper_F