Esempio n. 1
0
        private async Task RemoveOffer(Client client, uint offerId)
        {
            var result = await client.Player.RemoveItemFromMarketAsync(offerId);

            if (result != realm.entities.MarketResult.Success)
            {
                client.SendPacket(MarketResult.Error(result.GetDescription()));
                return;
            }

            client.SendPacket(MarketResult.Success("Your item has been removed and placed in your gift chest."));
            client.SendPacket(new GlobalNotification
            {
                Text = "giftChestOccupied"
            });
        }
Esempio n. 2
0
        private void AddOffers(Client client, MarketOffer[] newOffers)
        {
            if (newOffers.Length > 20 || newOffers.Select(o => o.Slot.SlotId).Distinct().Count() < newOffers.Length)
            {
                Log.Info($"Market Error {client.Player.Name}: Invalid offer.");
                client.SendPacket(MarketResult.Error("Invalid offer."));
                return;
            }

            var result = client.Player.AddToMarket(newOffers);

            if (result != realm.entities.MarketResult.Success)
            {
                client.SendPacket(MarketResult.Error(result.GetDescription()));
                return;
            }

            client.SendPacket(MarketResult.Success($"Your item{((newOffers.Length > 1) ? "s have" : " has")} been placed on market."));
        }
Esempio n. 3
0
        private void AddOffers(Client client, MarketOffer[] newOffers)
        {
            if (client.Player.Client.Account.Elite == 1)
            {
                client.Player.SendError("Elite accounts can't use the marketplace!");
                return;
            }

            if (newOffers.Length > 20 || newOffers.Select(o => o.Slot.SlotId).Distinct().Count() < newOffers.Length)
            {
                client.SendPacket(MarketResult.Error("Invalid offer."));
                return;
            }

            var result = client.Player.AddToMarket(newOffers);

            if (result != realm.entities.MarketResult.Success)
            {
                client.SendPacket(MarketResult.Error(result.GetDescription()));
                return;
            }

            client.SendPacket(MarketResult.Success($"Your item{((newOffers.Length > 1) ? "s have" : " has")} been placed on market."));
        }