Ejemplo n.º 1
0
        /////////////////////////////////////////////////////////////////////////////////
        // Move item to exchange slot (Will come when fixing exchange system).
        /////////////////////////////////////////////////////////////////////////////////
        void ItemMoveToExhangePage(byte f_slot)
        {
            #region Move to exchange
            try
            {
                PlayerMgr sys = Helpers.GetInformation.GetPlayer(Character.Network.TargetID);
                if (Character.Network.Exchange.ItemList.Count < 12 && sys.GetFreeSlotMax() > (byte)Character.Network.Exchange.ItemList.Count)
                {
                    ObjData.slotItem newitem = GetItem((uint)Character.Information.CharacterID, f_slot, 0);

                    LoadBluesid(newitem.dbID);
                    if (newitem.Amount <= ObjData.Manager.ItemBase[newitem.ID].Max_Stack)
                    {
                        Character.Network.Exchange.ItemList.Add(newitem);

                        client.Send(Packet.Exchange_ItemPacket(Character.Information.UniqueID, Character.Network.Exchange.ItemList, true));
                        sys.Send(Packet.Exchange_ItemPacket(sys.Character.Information.UniqueID, sys.Character.Network.Exchange.ItemList, true));

                        client.Send(Packet.Exchange_ItemSlot(4, f_slot));
                        sys.Send(Packet.Exchange_ItemSlot(4, f_slot));
                    }
                    else
                    {
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception("Exchange add item error: ", ex);
            }
            #endregion
        }