void Player_MoveStorageItemToInv(byte f_slot, byte t_slot, int o_id)
{
#region Move from storage to inv
try
{
//Check if the user isnt in any state/action that we will not allow.
if (!Character.State.Die || !Character.Stall.Stallactive || !Character.Alchemy.working || !Character.Position.Walking)
{
//Normal storage
if (!Character.Network.Guild.UsingStorage)
{
//Get free slots of player inventory
byte freeslot = GetFreeSlot();
//Get item information the one that user selected to move.
Global.slotItem item = GetItem((uint)Player.ID, f_slot, 1);
//Cannot drag and drop onto equip slots.
if (t_slot < 13) return;
//Update database information
MsSQL.UpdateData("UPDATE char_items SET itemnumber='item" + t_slot + "',slot='" + t_slot + "',storagetype='0', owner=" + Character.Information.CharacterID + " WHERE storageacc='" + Player.ID + "' AND id='" + item.dbID + "'");
//Send visual packet
client.Send(Packet.MoveItem(3, f_slot, t_slot, 0, 0, "MOVE_FROM_STORAGE"));
}
//Guild storage
else
{
//Get free slots of player inventory
byte freeslot = GetFreeSlot();
//Get item information the one that user selected to move.
Global.slotItem item = GetItem((uint)Player.ID, f_slot, 3);
//Cannot drag and drop onto equip slots.
if (t_slot < 13) return;
//Update database information
MsSQL.UpdateData("UPDATE char_items SET itemnumber='item" + t_slot + "',slot='" + t_slot + "',storagetype='0', owner=" + Character.Information.CharacterID + " WHERE guild_storage_id='" + Character.Network.Guild.Guildid + "' AND id='" + item.dbID + "'");
//Send visual packet
client.Send(Packet.MoveItem(3, f_slot, t_slot, 0, 0, "MOVE_FROM_GUILD_STORAGE"));
}
}
}
catch (Exception ex)
{
Console.WriteLine("Move item from storage error: {0}", ex);
Systems.Debugger.Write(ex);
}
//Save player information
SavePlayerInfo();
#endregion
}