Пример #1
0
        public InspectItemData(Item item, byte index)
        {
            CreatorGUID = item.GetGuidValue(ItemFields.Creator);

            Item   = new ItemInstance(item);
            Index  = index;
            Usable = true; // @todo

            for (EnchantmentSlot enchant = 0; enchant < EnchantmentSlot.Max; ++enchant)
            {
                uint enchId = item.GetEnchantmentId(enchant);
                if (enchId != 0)
                {
                    Enchants.Add(new InspectEnchantData(enchId, (byte)enchant));
                }
            }

            byte i = 0;

            foreach (ItemDynamicFieldGems gemData in item.GetGems())
            {
                if (gemData.ItemId != 0)
                {
                    ItemGemData gem = new ItemGemData();
                    gem.Slot = i;
                    gem.Item = new ItemInstance(gemData);
                    Gems.Add(gem);
                }
                ++i;
            }
        }
Пример #2
0
        public MailAttachedItem(Item item, byte pos)
        {
            Position      = pos;
            AttachID      = (int)item.GetGUID().GetCounter();
            Item          = new ItemInstance(item);
            Count         = item.GetCount();
            Charges       = item.GetSpellCharges();
            MaxDurability = item.GetUInt32Value(ItemFields.MaxDurability);
            Durability    = item.GetUInt32Value(ItemFields.Durability);
            Unlocked      = !item.IsLocked();

            for (EnchantmentSlot slot = 0; slot < EnchantmentSlot.MaxInspected; slot++)
            {
                if (item.GetEnchantmentId(slot) == 0)
                {
                    continue;
                }

                Enchants.Add(new ItemEnchantData((int)item.GetEnchantmentId(slot), item.GetEnchantmentDuration(slot), (int)item.GetEnchantmentCharges(slot), (byte)slot));
            }

            byte i = 0;

            foreach (ItemDynamicFieldGems gemData in item.GetGems())
            {
                if (gemData.ItemId != 0)
                {
                    ItemGemData gem = new ItemGemData();
                    gem.Slot = i;
                    gem.Item = new ItemInstance(gemData);
                    Gems.Add(gem);
                }
                ++i;
            }
        }
Пример #3
0
        public InspectItemData(Item item, byte index)
        {
            CreatorGUID = item.GetCreator();

            Item   = new ItemInstance(item);
            Index  = index;
            Usable = true; // @todo

            for (EnchantmentSlot enchant = 0; enchant < EnchantmentSlot.Max; ++enchant)
            {
                uint enchId = item.GetEnchantmentId(enchant);
                if (enchId != 0)
                {
                    Enchants.Add(new InspectEnchantData(enchId, (byte)enchant));
                }
            }

            byte i = 0;

            foreach (SocketedGem gemData in item.m_itemData.Gems)
            {
                if (gemData.ItemId != 0)
                {
                    ItemGemData gem = new ItemGemData();
                    gem.Slot = i;
                    gem.Item = new ItemInstance(gemData);
                    Gems.Add(gem);
                }
                ++i;
            }

            AzeriteItem azeriteItem = item.ToAzeriteItem();

            if (azeriteItem != null)
            {
                SelectedAzeriteEssences essences = azeriteItem.GetSelectedAzeriteEssences();
                if (essences != null)
                {
                    for (byte slot = 0; slot < essences.AzeriteEssenceID.GetSize(); ++slot)
                    {
                        AzeriteEssenceData essence = new AzeriteEssenceData();
                        essence.Index            = slot;
                        essence.AzeriteEssenceID = essences.AzeriteEssenceID[slot];
                        if (essence.AzeriteEssenceID != 0)
                        {
                            essence.Rank         = azeriteItem.GetEssenceRank(essence.AzeriteEssenceID);
                            essence.SlotUnlocked = true;
                        }
                        else
                        {
                            essence.SlotUnlocked = azeriteItem.HasUnlockedEssenceSlot(slot);
                        }

                        AzeriteEssences.Add(essence);
                    }
                }
            }
        }