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

HasItem - number of items?

Inrego

New Member
Joined
Feb 7, 2010
Messages
2,765
Reaction score
71
Hi there. In order to make quest profile writing better, Im trying to figure out if I can make it check how many I have of given item. For example a quest Im doing atm I need to pick up 4 of one type of items from one type of mobs, and then 4 of another type. If I could make a check how many I have of given item, I could make it stop killing the mobs that I already have the items for and dont need anymore, and make it run to the place where the other item drops.

I hope I made myself clear :p
 
If you talking about in a questing profile, I dont think you can do that, if you are talking about plugins then I am pretty sure you can do that, though I am not 100% sure how.
 
I am thinking about quest profiles. I think it'd be a nice addition to HB to make more efficient questing profiles.
 
Inrego said:
In order to make quest profile writing better, Im trying to figure out if I can make it check how many I have of given item.

For now, use this...
<If Condition="(Me.CarriedItems.Where(item => item.Entry == ITEM_ID).Sum(item => (int)item.StackCount)) <= 15">

MaiN has modified the HBcore to include a shortcut in the next release that boils it down to this:
<If Condition="GetItemCount(ITEM_ID) <= 15">


[Edit] Wiki updated here...
[wiki]Honorbuddy Profile Tag Attribute: Condition[/wiki]


cheers,
chinajade
 
Last edited:
ooo i'll have to test this on those buggy damn quests.

Thanks CJ.
 
Awesome! This can make a great improvement to the Wintersaber profile you released recently kick.
One more thing.
A similar thing to count how many it killed of 1 type of mob would be great too. Like KillCount in ppather.
 
chinajade are you sure this is working as expected? I believe I've tried every possible way, but it doesn't seem to work.

EDIT: Agree with vlad0327 ^
 
i would really put it to a grind to & gt ;= # to test it imo
 
Yea I tried putting it in a rly simple profile also just for testing, but it still failed. But I've been absent from profile making so long, that I'm not 100% confident I didn't oversee something.
 
I had started a thread with a similar question and the answer ended up being the ugly code way of using the item but just to collect a certain number of items from different NPC's I used the Objective command and that worked fine.
<code><code><PickUp QuestName="Demoniac Vessel" GiverName="Elijah Dawnflight" QuestId="25719" GiverId="42348" />
<!--
20 crushed Nightstalker Legs -->
<
Objective QuestName="Demoniac Vessel" QuestId="25719" Type="Collect" CollectCount="20" ItemId="57178" />
<!--
2 Screecher Brains -->
<
Objective QuestName="Demoniac Vessel" QuestId="25719" Type="Collect" CollectCount="2" ItemId="57179" />
<!--
4 Tainted Hides -->
<
Objective QuestName="Demoniac Vessel" QuestId="25719" Type="Collect" CollectCount="4" ItemId="57177" />
</code></code>
 
I had started a thread with a similar question and the answer ended up being the ugly code way of using the item but just to collect a certain number of items from different NPC's I used the Objective command and that worked fine.

Objective tag only tracks certain objective completion in your quest log. It does not count items in your inventory. If a quest requires you to collect # of items, yes that would work.
But some quests need you to collect a number of items (they are not tracked by quest log) and combine them into another item, which is then only tracked by quest log. And thats where Objective tag fails.
 
Objective tag only tracks certain objective completion in your quest log. It does not count items in your inventory. If a quest requires you to collect # of items, yes that would work.
But some quests need you to collect a number of items (they are not tracked by quest log) and combine them into another item, which is then only tracked by quest log. And thats where Objective tag fails.
Humm, If you follow the link the quest I was working on did not call out for any of the items I have in the code but it did collect them all - so I do not know how it worked but it worked for me on that quest at least.
 
Objective tag only tracks certain objective completion in your quest log. It does not count items in your inventory. If a quest requires you to collect # of items, yes that would work.
But some quests need you to collect a number of items (they are not tracked by quest log) and combine them into another item, which is then only tracked by quest log. And thats where Objective tag fails.

There's nothing wrong with using standard quest objectives for the actual item collection. It doesn't matter if the actual item ID pertains directly to a quest objective. The only difference between using a convoluted GrindTo with an appropriate predicate condition and a collection objective is that the collection objective will not be executed if the quest is completed and in the quest book or completed and turned in. So, you can do something like this:
PHP:
<If Condition="HasQuest(QUEST_ID) &amp;&amp; !IsQuestCompleted(QUEST_ID)">
<Objective QuestName="asdfasdf" QuestId="QUEST_ID" Type="CollectItem" ItemId="COLLECTION_ITEM" CollectCount="5" />
<UseItem ItemId="COMBINATION_ITEM" QuestName="asdfasdf" QuestId="QUEST_ID" X="1" Y="1" Z="1" />
</If>

Edit: And if you need to actually collect the item from some specific set of mobs or objects that simply belongs in the quest override, such as this quest: http://www.wowhead.com/quest=13875
 
Last edited:
Also, if you do it as a quest objective, the quest-ID will turn up as completed, and then I will only be doing the quest once, which isn't very practical for repeatable quests :P
 
Do you mean daily or reputation repeatable quests? For daily it would not matter since you will not be able to do it again until the next day when you can pick up the quest again anyway. For reputation type quest you can use any quest ID you have in your quest log since HB has no way of knowing if you need that item or not, so you can pick up any low level quest you never intend to complete and use that number or I have seen people use "<code><code>QuestId="0""</code></code> not sure if it would work here or not.
 
My point is if you need to collect some items and then combine them into another item for a quest to be completed, you can not use objective tag since it will keep on running until the quest log returns complete value, which will never occur. You need to combine the items and for that execute a RunMacro or other cb. Unless you use a plugin to do that ofc.
 
My point is if you need to collect some items and then combine them into another item for a quest to be completed, you can not use objective tag since it will keep on running until the quest log returns complete value, which will never occur. You need to combine the items and for that execute a RunMacro or other cb. Unless you use a plugin to do that ofc.
I decided to test this wilh a level 1 orc and just add in code pieces I had suggested.
Vlad0327 is correct in the fact that using "<code><code>QuestId="0""</code></code> will not work, it can not find the quest in its database so will not continue. You also can not add some random item into a quest and have it pick those up along the way somehow HB must know all the sub-items needed by a quest to complete it.
So the way I did my quest will not help for this topic.
 
Last edited:
Back
Top