38 if ( !item_to_pack.
IsTakeable() )
return false;
39 if ( item_to_pack.IsBeingPlaced() )
return false;
47 if ( item_to_pack.GetInventory().IsAttachment() )
49 if ( !item_to_pack.
CanDetachAttachment(tgt_parent) || !tgt_parent.CanReleaseAttachment(item_to_pack) )
54 if ( !item_to_pack.
CanRemoveFromCargo(tgt_parent) || !tgt_parent.CanReleaseCargo(item_to_pack) )
59 if ( item_to_pack.GetInventory().GetCargo() && item_to_pack.GetInventory().GetCargo().GetItemCount() > 0)
62 if ( !item_to_pack.IsWeapon() && item_to_pack.GetInventory().AttachmentCount() > 0)
67 g_Game.GetInventoryItemSize( item_to_pack,
x,
y );
80 player.RemoveQuickBarEntityShortcut(item_to_pack);
94 g_Game.GetInventoryItemSize( item_to_pack,
x,
y );
99 if(
x <= 2 &&
y <= 2 )
101 typeName =
"GiftBox_Small_" + rnd;
103 else if(
x <= 3 &&
y <= 3 )
105 typeName =
"GiftBox_Medium_" + rnd;
107 else if(
x <= 5 &&
y <= 5 )
109 typeName =
"GiftBox_Large_" + rnd;
114 if (!
g_Game.IsDedicatedServer())
116 player.RemoveQuickBarEntityShortcut(item_to_pack);
125 player.ServerReplaceItemWithNew(lambda);
143 super.OnSuccess(new_item);
146 m_ItemToCargo.GetInventory().GetCurrentInventoryLocation(src);
153 if(
g_Game.IsDedicatedServer())
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
void ClearInventoryReservationEx(ActionData action_data)
void ClearActionJuncture(ActionData action_data)
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
void ActionContinuousBase()
ref ActionTarget m_Target
override void OnFinishProgressClient(ActionData action_data)
override void CreateConditionComponents()
override void OnFinishProgressServer(ActionData action_data)
override bool HasTarget()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateActionComponent()
proto native bool IsValid()
verify current set inventory location
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
override bool CanDetachAttachment(EntityAI parent)
override bool CanRemoveFromCargo(EntityAI parent)
override bool CanPutInCargo(EntityAI parent)
override bool IsTakeable()
void ReplaceWithNewReciveCargoLambda(EntityAI old_item, string new_item_type, PlayerBase player, EntityAI item_to_cargo)
override void OnSuccess(EntityAI new_item)
DayZPlayerConstants
defined in C++
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].