What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

WoWItem: quest item?

jim87

New Member
Joined
Aug 26, 2011
Messages
445
Reaction score
7
Hello!

I'd like to know if it's possible, via HB APIs, to know if an item is a quest one. I've only found WoWItem.QuestGiverStatus, but that's only for quest-giving items.

Thanks.
 
Well, if I have to use Lua... should this work right?

PHP:
        // Note: Dictionary<uint, bool> questItems

        private bool checkIsQuestItem(WoWItem item)
        {
            try
            {
                if (questItems.ContainsKey(item.Entry))
                    return questItems[item.Entry];

                uint i = 0;
                WoWContainer bag;
                while (ObjectManager.Me.GetBagAtIndex(i) != null)
                {
                    bag = ObjectManager.Me.GetBagAtIndex(i);
                    WoWItem[] itemsInBag = bag.Items;
                    if (itemsInBag[item.BagSlot] != null && itemsInBag[item.BagSlot].Entry == item.Entry)
                    {
                        List<String> response = Lua.GetReturnValues(String.Format("return GetContainerItemQuestInfo({0}, {1})", bag.BagIndex, item.BagSlot));
                        questItems.Add(item.Entry, response[0].ToBoolean());
                        return response[0].ToBoolean();
                    }
                }
            }
            catch (Exception ex)
            {
                Log(ex.ToString());
            }

            return false;
        }
 
Last edited:
It doesn't seem like you increment your i-value.
Also, I would do all the work in the lua code, instead of using GetReturnVal in a while loop.
If you need help I can help you out with the lua part.
 
Back
Top