mirror of
https://git.muiegratis.online/suikoakari/Campofinale
synced 2025-12-23 06:54:41 +01:00
58 lines
1.5 KiB
C#
58 lines
1.5 KiB
C#
using Campofinale.Game.Inventory;
|
|
using Campofinale.Network;
|
|
using Campofinale.Protocol;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Security.Cryptography;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Campofinale.Packets.Sc
|
|
{
|
|
public class PacketScItemBagScopeModify : Packet
|
|
{
|
|
|
|
public PacketScItemBagScopeModify(Player client, Item item) {
|
|
|
|
if (item == null)
|
|
{
|
|
SetData(ScMsgId.ScItemBagScopeModify, new ScItemBagScopeModify());
|
|
return;
|
|
}
|
|
ScItemBagScopeModify proto = new ScItemBagScopeModify()
|
|
{
|
|
Depot =
|
|
{
|
|
{(int)item.ItemType,new ScdItemDepotModify(){
|
|
|
|
}
|
|
}
|
|
},
|
|
ScopeName=1,
|
|
|
|
};
|
|
if (item.InstanceType())
|
|
{
|
|
if (item.amount <= 0)
|
|
{
|
|
proto.Depot[(int)item.ItemType].DelInstList.Add(item.guid);
|
|
}
|
|
else
|
|
{
|
|
proto.Depot[(int)item.ItemType].InstList.Add(item.ToProto());
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
proto.Depot[(int)item.ItemType].Items.Add(item.id, item.amount);
|
|
|
|
}
|
|
|
|
SetData(ScMsgId.ScItemBagScopeModify, proto);
|
|
}
|
|
|
|
}
|
|
}
|