What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

WoWItem.IsMillable || WowItem.IsDisenchantable

CarlMGregory

New Member
Joined
Mar 8, 2010
Messages
44
Namespace: Styx.WoWInternals.WoWObjects
Assembly: Styx (in Styx.dll) Version: 1.0.0.0 (1.0.0.0)
public bool IsMillable { get; }

Ran a test on Earthroot, I can mill it... yet this returned false... why?

Test code.

Code:
private void myDebugTesting() {
	Styx.Helpers.Logging.Write("Running test.");
	ObjectManager.Update();
	List<WoWItem> items = ObjectManager.GetObjectsOfType<WoWItem>(false);
	for (int x = items.Count-1; x >= 0; x--) {
		if (items[x].Name!="Earthroot") continue;
		Styx.Helpers.Logging.Write(". Item: {0}", items[x].Name);
		Styx.Helpers.Logging.Write(".. Entry: {0}", items[x].Entry);
		Styx.Helpers.Logging.Write(".. IsMillable: {0}", items[x].IsMillable);
	}
	Styx.Helpers.Logging.Write("Debug testing complete.");
}

Maybe I am misunderstanding what the property is to be, but I thought it was to be true if I could mill it (high enough milling skill level, quantity count was enough (5 Earthroot required to mill)). Am I mistaken?

Also, assuming it's supposed to work, sure would be nice to have a IsDisenchantable property too. Is that in the works, or is there a workaround that anyone can suggest?

Thank you.
 
Its possible that IsMillable is bugged, I sent Nesox a message about it.

You can find more info about Disenchanting here:
Code:
        #region Enchanting

        private static readonly List<WoWItem> AlreadyDisenchanted = new List<WoWItem>();

        /// <summary>
        /// List from wowhead
        /// http://www.wowhead.com/?items=7.12#0+2-1
        /// </summary>
        private readonly List<uint> _doNotDisenchant = new List<uint>()
        {
            // mats
            10940, 10938, 10939, 10998, 10978, 11082, 11083, 11084, 11134, 11139, 11174, 11175,
            11176, 11177, 11178, 14343, 14344, 16202, 16203, 16204, 20725, 22445, 22446, 22447,
            22448, 22449, 22450, 34052, 34053, 34054, 34055, 34056, 34057, 46849, 49649,
            // rods
            44452,
            // lockbox
            43622,
            // healthstones
            5509, 5510, 5511, 5512, 9421, 19004, 19005, 19006,  
            19007, 19008, 19009, 19010, 19011, 19012, 19013, 
            22103, 22104, 22105, 36889, 36890, 36891, 36892,
            36893, 36894,
            // soulstones

            // firestones
            3615, 3616, 3617, 3618, 3619, 3620,

            // spellstones
            41191, 41192, 41193, 41194, 41195, 41196,
        };

        private List<WoWItem> GetItemsToDisenchant()
        {
            try
            {
                if (!DisenchantGreens || !SpellManager.KnownSpells.ContainsKey("Disenchant") || Me.ZoneId == 3277 || Me.ZoneId == 3358 || Me.ZoneId == 2597) // wsg, ab and av
                    return null;

                List<WoWItem> targetItems = ObjectManager.GetObjectsOfType<WoWItem>(false);

                for (int a = targetItems.Count - 1; a >= 0; --a)
                {
                    if (_doNotDisenchant.Contains(targetItems[a].Entry) ||
                        AlreadyDisenchanted.Contains(targetItems[a]))
                    {
                        targetItems.RemoveAt(a);
                    }
                    else if (targetItems[a].IsSoulbound ||
                        targetItems[a].IsAccountBound ||
                        targetItems[a].Quality != WoWItemQuality.Uncommon)
                    {
                        AlreadyDisenchanted.Add(targetItems[a]);
                        targetItems.RemoveAt(a);
                    }
                }

                if (targetItems.Count > 0)
                {
                    foreach (WoWItem deItem in targetItems)
                    {
                        Log("Disenchant: {0}.", deItem.Name);
                    }
                    return targetItems;
                }
            }
            catch
            {
                Log("Getting Disenchant list failed");
            }

            // Log("Nothing to Disenchant.");
            return null;
        }

        private static void DisenchantItems(IEnumerable<WoWItem> itemList)
        {
            try
            {
                if (itemList == null)
                    return;

                foreach (WoWItem item in itemList)
                {
                    Log("Disenchanting: {0} Entry: {1}.", item.Name, item.Entry);
                    SpellManager.CastSpell("Disenchant", false);
                    Thread.Sleep(500);
                    Lua.DoString("UseItemByName(\"" + item.Name + "\")");

                    Thread.Sleep(500);

                    int tickCount = Environment.TickCount;
                    while (Me.Casting > 0 && !Me.Combat && Environment.TickCount - tickCount <= 5000)
                        Thread.Sleep(250);

                    Thread.Sleep(2500);

                    // wait for lootframe to close
                    var timer = new Stopwatch();
                    timer.Start();

                    tickCount = Environment.TickCount;
                    while (ObjectManager.Wow.ReadUInt((uint)GlobalOffsets.LootFrame) != 0 && !Me.Combat && Environment.TickCount - tickCount <= 7000)
                    {
                        Thread.Sleep(1000);

                        if (timer.ElapsedMilliseconds >= 6000)
                        {
                            break;
                        }
                    }

                    if (!Me.Combat)
                    {
                        Thread.Sleep(1500);
                        AlreadyDisenchanted.Add(item);
                    }
                    else
                    {
                        return;
                    }
                }
            }
            catch
            {
                Log("DE failed");
                return;
            }
            return;
        }

        #endregion
 
Hrm, yea. That's the code I use now, more or less. Was hoping to find a way to determine what the enchanting level required is for the item and match it against my skill level for enchanting.
 
Hrm... I learn by example and cannot find any examples of this. Someone care to give me an example of how to utalize this?
Code:
public int DisenchantSkillLevel
    Member of Styx.Object_Dumping_Enumeration.WoWCache.WoWCache.ItemCacheEntry

I assume that will give you an item's disenchant skill level required to disenchant it? Great, if I can figure out how to use it (yes, I'm a c# newbie, but been programming for 17 years so I'm not a complete retard).
 
Back
Top