Exemplo n.º 1
0
        public void buylist(L2Player player, L2Citizen trader, short reply)
        {
            if (!_shops.ContainsKey(trader.Template.NpcId))
            {
                player.sendMessage("you shop was not found");
                player.sendActionFailed();
                return;
            }

            ND_shop shop = _shops[trader.Template.NpcId];
            GameServerNetworkPacket pk;

            if (!shop.lists.ContainsKey(reply))
            {
                reply -= 2; // примерка

                if (!shop.lists.ContainsKey(reply))
                {
                    player.sendMessage("your shop id was just wrong " + reply);
                    player.sendActionFailed();
                    return;
                }
                else
                {
                    pk = new ShopPreviewList(player, shop.lists[reply], reply);
                }
            }
            else
            {
                player.sendPacket(new ExBuySellList_Buy(player, shop.lists[reply], 1.10, 1.0, reply));
                player.sendPacket(new ExBuySellList_Sell(player));
            }
        }
Exemplo n.º 2
0
        public void Buylist(L2Player player, L2Npc trader, short reply)
        {
            if (!Shops.ContainsKey(trader.Template.NpcId))
            {
                player.SendMessage("you shop was not found");
                player.SendActionFailed();
                return;
            }

            NDShop           shop = Shops[trader.Template.NpcId];
            GameserverPacket pk;

            if (!shop.Lists.ContainsKey(reply))
            {
                reply -= 2; // примерка

                if (!shop.Lists.ContainsKey(reply))
                {
                    player.SendMessage($"your shop id was just wrong {reply}");
                    player.SendActionFailed();
                }
                else
                {
                    pk = new ShopPreviewList(player, shop.Lists[reply], reply);
                }
            }
            else
            {
                player.SendPacket(new ExBuySellListBuy(player, shop.Lists[reply], 1.10, 1.0, reply));
                player.SendPacket(new ExBuySellListSell(player));
            }
        }