Represents a regular NPC shop.
The difference between a gold and a ducat shop is: none. The secret lies in the DucatPrice value of ItemOptionInfo. If it is > 0, the client shows that, instead of the gold price, and assumes that you're paying with ducats. TODO: Find the best way to add ducat items. Mixing the two should be possible I suppose. AddItem/AddDucatItem? Selling items always uses gold (option to sell for ducats?). Aside from Ducats and Gold there are two more currencies, Stars and Pons. The client will show the buy currency based on the values set, Duncan > Stars > Gold. Pons overweights everything, but it's displayed alongside other prices if they aren't 0.
Наследование: IScript, IDisposable
Пример #1
0
        /// <summary>
        /// Sends OpenNpcShop to creature's client.
        /// </summary>
        /// <param name="creature"></param>
        /// <param name="shop"></param>
        public static void OpenNpcShop(Creature creature, NpcShopScript shop)
        {
            var packet = new Packet(Op.OpenNpcShop, creature.EntityId);
            packet.PutString("shopname");
            packet.PutByte(0);
            packet.PutByte(0);
            packet.PutInt(0);
            packet.PutByte((byte)shop.Tabs.Count);
            foreach (var tab in shop.Tabs)
            {
                packet.PutString("[{0}]{1}", tab.Order, tab.Title);

                // [160200] ?
                {
                    packet.PutByte(0);
                }

                packet.PutShort((short)tab.Items.Count);
                foreach (var item in tab.Items)
                    packet.AddItemInfo(item, ItemPacketType.Private);
            }

            creature.Client.Send(packet);
        }