Code:
//GetbankMenoy.cs
using System;
using System.Collections.Generic;
using System.Text;
using COServer;
namespace COServer.clientpackets
{
class GetbankMenoy : GameBasePacket
{
private byte[] _packet;
private COClient _client;
public GetbankMenoy(byte[] packet, COClient client)
{
_packet = packet;
_client = client;
runImpl();
}
void runImpl()
{
int key = (_packet[0x013] << 24) + (_packet[0x012] << 16) + (_packet[0x011] << 8) + _packet[0x010];
int NPCid = (_packet[0x07] << 24) + (_packet[0x06] << 16) + (_packet[0x05] << 8) + _packet[0x04];
byte[] data = new byte[] { 0x14, 0x00, 0xf1, 0x03, (byte)(NPCid & 0xff), (byte)((NPCid >> 8) & 0xff), (byte)((NPCid >> 16) & 0xff), (byte)((_client.Char.WhMoney>> 24) & 0xff), (byte)(_client.Char.WhMoney & 0xff), (byte)((_client.Char.WhMoney >> 8) & 0xff), (byte)((_client.Char.WhMoney >> 16) & 0xff), (byte)((_client.Char.WhMoney >> 24) & 0xff), 0x09, 0x00, 0x00, 0x00, (byte)(key & 0xff), (byte)((key >> 8) & 0xff), (byte)((key >> 16) & 0xff), (byte)((key >> 24) & 0xff) };
_client.SendData(data);
}
}
}
// Collectmoney.cs
using System;
using System.Collections.Generic;
using System.Text;
using COServer.Network.Packet;
namespace COServer.clientpackets
{
class Collectmoney : GameBasePacket
{
private byte[] _packet;
private COClient _client;
ConquerPacket CPacket = new ConquerPacket();
public Collectmoney(byte[] packet, COClient client)
{
_packet = packet;
_client = client;
runImpl();
}
void runImpl()
{
int money = (int)((_packet[0x0b] << 24) + (_packet[0x0a] << 16) + (_packet[0x09] << 8) + _packet[0x08]);
int NPCid = (_packet[0x07] << 24) + (_packet[0x06] << 16) + (_packet[0x05] << 8) + _packet[0x04];
if (_client.Char.WhMoney > (money-1))
{
_client.Char.WhMoney -= money;
_client.Char.Money += money;
int key = 0;
byte[] data = new byte[] { 0x14, 0x00, 0xf1, 0x03, (byte)(NPCid & 0xff), (byte)((NPCid >> 8) & 0xff), (byte)((NPCid >> 16) & 0xff), (byte)((_client.Char.WhMoney >> 24) & 0xff), (byte)(_client.Char.WhMoney & 0xff), (byte)((_client.Char.WhMoney >> 8) & 0xff), (byte)((_client.Char.WhMoney >> 16) & 0xff), (byte)((_client.Char.WhMoney >> 24) & 0xff), 0x09, 0x00, 0x00, 0x00, (byte)(key & 0xff), (byte)((key >> 8) & 0xff), (byte)((key >> 16) & 0xff), (byte)((key >> 24) & 0xff) };
_client.SendData(data);
_client.SendData(CPacket.UpdateMoney(_client.Char));
}
}
}
}
//StorageMoney.cs
using System;
using System.Collections.Generic;
using System.Text;
using COServer.Network.Packet;
namespace COServer.clientpackets
{
class StorageMoney : GameBasePacket
{
private byte[] _packet;
private COClient _client;
ConquerPacket CPacket = new ConquerPacket();
public StorageMoney(byte[] packet, COClient client)
{
_packet = packet;
_client = client;
runImpl();
}
void runImpl()
{
int money =(int)((_packet[0x0b] << 24) + (_packet[0x0a] << 16) + (_packet[0x09] << 8) + _packet[0x08]);
int NPCid = (_packet[0x07] << 24) + (_packet[0x06] << 16) + (_packet[0x05] << 8) + _packet[0x04];
if (_client.Char.Money > money-1)
{
_client.Char.Money -= money;
_client.Char.WhMoney += money;
int key = 0;
byte[] data = new byte[] { 0x14, 0x00, 0xf1, 0x03, (byte)(NPCid & 0xff), (byte)((NPCid >> 8) & 0xff), (byte)((NPCid >> 16) & 0xff), (byte)((_client.Char.WhMoney >> 24) & 0xff), (byte)(_client.Char.WhMoney & 0xff), (byte)((_client.Char.WhMoney >> 8) & 0xff), (byte)((_client.Char.WhMoney >> 16) & 0xff), (byte)((_client.Char.WhMoney >> 24) & 0xff), 0x09, 0x00, 0x00, 0x00, (byte)(key & 0xff), (byte)((key >> 8) & 0xff), (byte)((key >> 16) & 0xff), (byte)((key >> 24) & 0xff) };
_client.SendData(data);
_client.SendData(CPacket.UpdateMoney(_client.Char));
}
}
}
}
// RequestWarehouse.cs
using System;
using System.Collections.Generic;
using System.Text;
using COServer;
using COServer.Network.Packet;
using COServer.Network;
namespace COServer.clientpackets
{
class RequestWarehouse : GameBasePacket
{
private byte[] _packet;
private COClient _client;
private Character _char;
private int ItemID;
private int UID;
public RequestWarehouse(byte[] packet, COClient client)
{
_packet = packet;
_client = client;
runImpl();
}
void runImpl()
{
ConquerPacket CPacket = new ConquerPacket();
int Packet = (_packet[3] << 8) + (_packet[2]);
if (_client.Status == Mode.World)
{
if (Packet == 1102)
{
int NPCID = (_packet[7] << 24) + (_packet[6] << 16) + (_packet[5] << 8) + (_packet[4]);
int ItemUID = (_packet[15] << 24) + (_packet[14] << 16) + (_packet[13] << 8) + (_packet[12]);
int Type = (_packet[8]);
int Amount = 0;
int[][] warehouse = null;
if (NPCID == 8)//twincity
{
warehouse = _client.Char.TwinWare;
}
if (NPCID == 10012)//phoenix castle
{
// warehouse = _client.Char.PhoenixWare;
}
if (NPCID == 10028)//ape mountain
{
// warehouse = _client.Char.ApeWare;
}
if (NPCID == 10011)//desert city
{
// warehouse = _client.Char.DesertWare;
}
if (NPCID == 10027)//bird island
{
// warehouse = _client.Char.BirdWare;
}
if (NPCID == 44)//market
{
// warehouse = _client.Char.MarketWare;
}
if (Type == 0) // 返回銀行物品
{
foreach (int[] Item in warehouse)
{
if (Item[0] != 0)
{
Amount++;
}
}
Warehouse GetWarehouse = new Warehouse(NPCID, Amount, 0, 0, _client);
GetWarehouse.getBankitem();
}
#region 銀行:
if (Type == 1) // 放物品
{
Warehouse GetWarehouse = new Warehouse(NPCID, Amount, 0, 0, _client);
GetWarehouse.Saveitem(_packet);
}
else if (Type == 2) //拿物品
{
Warehouse GetWarehouse = new Warehouse(NPCID, Amount, 0, 0, _client);
GetWarehouse.Getitem(_packet);
}
#endregion
}
}
}
}
}