85 {
87 ItemBase item = action_data.m_MainItem;
88 PlayerBase player = action_data.m_Player;
89 string typeName;
90
91 if (item_to_pack)
92 {
95 int rnd = Math.RandomIntInclusive(1, 4);
96
97 ReplaceWithNewReciveCargoLambda lambda;
98
99 if(
x <= 2 &&
y <= 2 )
100 {
101 typeName = "GiftBox_Small_" + rnd;
102 }
103 else if(
x <= 3 &&
y <= 3 )
104 {
105 typeName = "GiftBox_Medium_" + rnd;
106 }
107 else if(
x <= 5 &&
y <= 5 )
108 {
109 typeName = "GiftBox_Large_" + rnd;
110 }
111 else return;
112
113
114 if(!
GetGame().IsDedicatedServer())
115 player.RemoveQuickBarEntityShortcut(item_to_pack);
116
117 lambda = new ReplaceWithNewReciveCargoLambda( item, typeName, player,item_to_pack);
118 player.ServerReplaceItemWithNew(lambda);
119
120 }
121
122
123 }
class GP5GasMask extends MaskBase ItemBase
proto void GetInventoryItemSize(InventoryItem item, out int width, out int height)
proto native CGame GetGame()