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)
80 player.RemoveQuickBarEntityShortcut(item_to_pack);
87 ItemBase item = action_data.m_MainItem;
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(!
GetGame().IsDedicatedServer())
115 player.RemoveQuickBarEntityShortcut(item_to_pack);
118 player.ServerReplaceItemWithNew(lambda);
136 super.OnSuccess(new_item);
139 m_ItemToCargo.GetInventory().GetCurrentInventoryLocation(src);
146 if(
GetGame().IsDedicatedServer())
class ActionTargets ActionTarget
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
void ActionContinuousBase()
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 void GetInventoryItemSize(InventoryItem item, out int width, out int height)
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++
proto native CGame GetGame()
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].