/// <summary>
        /// Generates a new item id
        /// </summary>
        public short GenerateNewItemId(MmoItemType itemType)
        {
            for (short i = 10; i <= short.MaxValue; i++)
            {
                if (!dataHandler.MmoItems.ContainsKey(i))
                {
                    return(i);
                }
            }

            throw new ArithmeticException("Max Id limit reached");
        }
Beispiel #2
0
        /// <summary>
        /// Creates a new instance of the <see cref="MmoItem"/> class from <see cref="GameItemData"/>.
        /// </summary>
        public MmoItem(GameItemData itemData)
        {
            this.id       = itemData.ItemId;
            this.type     = (MmoItemType)itemData.ItemType;
            this.level    = itemData.Level;
            this.rareness = (Rarity)itemData.Rarity;

            this.sellPrice   = itemData.SellPrice;
            this.buyoutPrice = itemData.BuyoutPrice;

            this.maxStack = itemData.MaxStack;
            this.useLimit = (UseLimit)itemData.UseLimit;
            this.spellId  = itemData.UseSpellId;

            this.count = 1;
        }