using System;
namespace Conquer_Online_Server.Network.GamePackets
{
public class ItemUsage : Writer, Interfaces.IPacket
{
public const ushort
BuyFromNPC = 1,
SellToNPC = 2,
RemoveInventory = 3,
DropItem = 37,
EquipItem = 4,
UnequipItem = 6,
ViewWarehouse = 9,
WarehouseDeposit = 10,
WarehouseWithdraw = 11,
DropMoney = 38,
Repair = 14,
DragonBallUpgrade = 19,
MeteorUpgrade = 20,
Ping = 27;
byte[] Buffer;
public ItemUsage(bool Create)
{
if (Create)
{
this.Buffer = new byte[0x20];
Writer.WriteUInt16(0x18, 0, this.Buffer);
Writer.WriteUInt16(0x3f1, 2, this.Buffer);
}
}
public uint dwExtraInfo
{
get
{
return BitConverter.ToUInt32(this.Buffer, 20);
}
set
{
Writer.WriteUInt32(value, 20, this.Buffer);
}
}
public uint dwParam
{
get
{
return BitConverter.ToUInt32(this.Buffer, 8);
}
set
{
Writer.WriteUInt32(value, 8, this.Buffer);
}
}
public uint ID
{
get
{
return BitConverter.ToUInt32(this.Buffer, 12);
}
set
{
Writer.WriteUInt32(value, 12, this.Buffer);
}
}
public uint Position
{
get
{
return BitConverter.ToUInt32(this.Buffer, 8);
}
set
{
Writer.WriteUInt32(value, 8, this.Buffer);
}
}
public uint TimeStamp
{
get
{
return BitConverter.ToUInt32(this.Buffer, 0x10);
}
set
{
Writer.WriteUInt32(value, 0x10, this.Buffer);
}
}
public uint UID
{
get
{
return BitConverter.ToUInt32(this.Buffer, 4);
}
set
{
Writer.WriteUInt32(value, 4, this.Buffer);
}
}
public byte[] ToArray()
{
return Buffer;
}
public void Deserialize(byte[] buffer)
{
Buffer = buffer;
}
public void Send(Client.GameState client)
{
client.Send(Buffer);
}
}
}
|