Exemple #1
0
        public void Buy(uint uid, uint quantity, uint price)
        {
            BidShopItemRecord item = this.GetItem(uid);

            if (item != null)
            {
                if (item.Price == price)
                {
                    if (this.Character.RemoveKamas((int)price))
                    {
                        this.Character.Inventory.AddItem(item.ToCharacterItemRecord(this.Character.Id));
                        item.RemoveElement();
                        this.ShowList(item.GId);

                        if (this.Items.Count(x => x.GId == item.GId) == 0)
                        {
                            this.RemoveGId(item.GId);
                        }

                        this.AddGain(item);
                    }
                }
            }
            else
            {
                this.Character.TextInformation(TextInformationTypeEnum.TEXT_INFORMATION_MESSAGE, 64);
                this.ShowList(this.GIdWatched);
                this.ShowTypes(this.GIdWatched);
            }
        }
        public override void MoveItem(uint uid, int quantity)
        {
            if (quantity < 0)
            {
                BidShopItemRecord item = this.GetSelledItem(uid);

                if (item != null && item.Quantity >= Math.Abs(quantity))
                {
                    item.RemoveElement();
                    this.SelledItems.Remove(item);
                    this.Character.Inventory.AddItem(item.ToCharacterItemRecord(this.Character.Id));
                    this.Character.Client.Send(new ExchangeBidHouseItemRemoveOkMessage((int)uid));
                }
            }
        }