Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SongItem"/> class.
 /// </summary>
 /// <param name="itemId">The item identifier.</param>
 /// <param name="songId">The song identifier.</param>
 /// <param name="baseItem">The base item.</param>
 /// <param name="extraData">The extra data.</param>
 /// <param name="songCode">The song code.</param>
 public SongItem(uint itemId, uint songId, int baseItem, string extraData, string songCode)
 {
     ItemId = itemId;
     SongId = songId;
     BaseItem = AzureEmulator.GetGame().GetItemManager().GetItem(((uint)baseItem));
     ExtraData = extraData;
     SongCode = songCode;
 }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UserItem"/> class.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <param name="baseItemId">The base item identifier.</param>
        /// <param name="extraData">The extra data.</param>
        /// <param name="group">The group.</param>
        /// <param name="songCode">The song code.</param>
        internal UserItem(uint id, uint baseItemId, string extraData, int group, string songCode)
        {
            Id = id;
            BaseItemId = baseItemId;
            ExtraData = extraData;
            GroupId = group;
            BaseItem = AzureEmulator.GetGame().GetItemManager().GetItem(baseItemId);

            if (BaseItem == null)
                return;
            using (var queryReactor = AzureEmulator.GetDatabaseManager().GetQueryReactor())
            {
                queryReactor.SetQuery(string.Format("SELECT * FROM items_limited WHERE item_id={0} LIMIT 1", id));
                var row = queryReactor.GetRow();
                if (row != null)
                {
                    uint.TryParse(row[1].ToString(), out LimitedSellId);
                    uint.TryParse(row[2].ToString(), out LimitedStack);
                }
            }

            IsWallItem = (BaseItem.Type == 'i');
            SongCode = songCode;
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SongItem"/> class.
 /// </summary>
 /// <param name="item">The item.</param>
 public SongItem(UserItem item)
 {
     ItemId = item.Id;
     SongId = SongManager.GetSongId(item.SongCode);
     BaseItem = item.BaseItem;
 }