/// <summary>
 /// Adds a stockable item to the list
 /// </summary>
 /// <param name="ItemId">Itemid to lookup</param>
 /// <param name="count">Number of items to stock</param>
 public void AddGoods(uint ItemId, byte count)
 {
     Rag2Item item;
     if (Singleton.Item.TryGetItemWithCount(ItemId, count, out item))
     {
         ShopPair pair = new ShopPair(item, false);
         list.Add(pair);
     }
 }
示例#2
0
        /// <summary>
        /// Adds a stockable item to the list
        /// </summary>
        /// <param name="ItemId">Itemid to lookup</param>
        /// <param name="count">Number of items to stock</param>
        public void AddGoods(uint ItemId, byte count)
        {
            Rag2Item item;

            if (Singleton.Item.TryGetItemWithCount(ItemId, count, out item))
            {
                ShopPair pair = new ShopPair(item, false);
                list.Add(pair);
            }
        }
示例#3
0
        /// <summary>
        /// Opens the shop
        /// </summary>
        /// <param name="character">Character to show the shop</param>
        /// <param name="basenpc">Npc providing the v</param>
        public override void Open(Saga.PrimaryTypes.Character character, Saga.Templates.BaseNPC basenpc)
        {
            character.Tag = this;
            SMSG_SHOPLIST spkt = new SMSG_SHOPLIST();

            spkt.SessionId   = character.id;
            spkt.SourceActor = basenpc.id;
            spkt.Zeny        = basenpc.Zeny;
            for (int i = 0; i < list.Count; i++)
            {
                ShopPair c = list[i];
                if (c.NoStock == true || c.item.count > 0)
                {
                    spkt.AddItem(c.item, c.NoStock, i);
                }
            }
            character.client.Send((byte[])spkt);
            CommonFunctions.SendRebuylist(character);
        }