Exemple #1
0
        /// <summary>
        /// Gets a item description pre-formatted into friendly data.
        /// </summary>
        /// <param name="index">Index of item.</param>
        /// <returns>ItemTemplate</returns>
        public ItemDescription GetItemDescription(int index)
        {
            ItemDescription desc = new ItemDescription();

            if (items.Count > 0 && index >= 0 && index < items.Count)
            {
                DFItem item = items[index];
                desc.name                    = Encoding.UTF8.GetString(item.name).TrimEnd('\0');
                desc.baseWeight              = (float)item.baseWeightUnits * 0.25f;
                desc.hitPoints               = item.hitPoints;
                desc.Unknown1                = item.Unknown1;
                desc.enchantmentPoints       = item.enchantmentPoints;
                desc.Unknown2                = item.Unknown2;
                desc.drawOrder               = item.drawOrder;
                desc.Unknown3                = item.Unknown3;
                desc.isIngredient            = ((item.Unknown3 & 1) == 1) ? true : false;
                desc.inventoryTextureArchive = item.inventoryTextureBitfield >> 7;
                desc.inventoryTextureRecord  = item.inventoryTextureBitfield & 0x7f;
                desc.paperDollTextureArchive = item.paperDollTextureBitfield >> 7;
                desc.paperDollTextureRecord  = item.paperDollTextureBitfield & 0x7f;
            }

            return(desc);
        }
Exemple #2
0
        /// <summary>
        /// Gets a item description pre-formatted into friendly data.
        /// </summary>
        /// <param name="index">Index of item.</param>
        /// <returns>ItemTemplate</returns>
        public ItemDescription GetItemDescription(int index)
        {
            ItemDescription desc = new ItemDescription();
            if (items.Count > 0 && index >= 0 && index < items.Count)
            {
                DFItem item = items[index];
                desc.name = Encoding.UTF8.GetString(item.name).TrimEnd('\0');
                desc.baseWeight = (float)item.baseWeightUnits * 0.25f;
                desc.hitPoints = item.hitPoints;
                desc.Unknown1 = item.Unknown1;
                desc.enchantmentPoints = item.enchantmentPoints;
                desc.Unknown2 = item.Unknown2;
                desc.drawOrder = item.drawOrder;
                desc.Unknown3 = item.Unknown3;
                desc.isIngredient = ((item.Unknown3 & 1) == 1) ? true : false;
                desc.inventoryTextureArchive = item.inventoryTextureBitfield >> 7;
                desc.inventoryTextureRecord = item.inventoryTextureBitfield & 0x7f;
                desc.paperDollTextureArchive = item.paperDollTextureBitfield >> 7;
                desc.paperDollTextureRecord = item.paperDollTextureBitfield & 0x7f;
            }

            return desc;
        }