Questie

Questie

121M Downloads

Add hint about quest items no longer needed

Gogo1951 opened this issue ยท 9 comments

commented

Question

I have a little PoC going around this.

image

I think this would be a godsend for cleaning bags.

I've been manually building a list, but you guys know the DB better than I do. All the function does is delete the lowest value item in your bags, and look at quest items to see if you've completed the relevant quests. Building the data list is the hard part. Getting all the quest items + quests, and provided items for quests + quests, and little "flavor" items like books and notes + quests... but once you have that, cleaning bags is a snap. Ha.

local AllowedDeleteQuestItems = {
    -- Example: [ItemID]     = {QuestID1, QuestID2, ...}
    -- Item Name | Quest Name(s), Quest Name(s)
    [10515]  = {3463},       -- Torch of Retribution | Set Them Ablaze!
    [1358]   = {138},        
    [1361]   = {139},
    [1362]   = {140},
    [16991]  = {6624, 6622},  -- Example of item with quests for both factions
    [2154]   = {231},
    [3248]   = {253},
    [5884]   = {1206},
    [7667]   = {2200},
    [7668]   = {2201, 2339},
    [7846]   = {2258, 2500},
    [7907]   = {2282},
    [8046]   = {2359},
    [8047]   = {17, 2202},
    [9279]   = {2930},
    [9309]   = {2928},
    [9326]   = {2945},
commented

We certainly don't want an option to delete the lowest value item in the inventory. That is something out of scope for Questie.

But a notification about quest items that are no longer needed is on our list for quite some time. I can't find the feature request, so I'll keep this open for now.

As always: Pull requests are welcome.

commented

Actually instead of generating a list, I guess it's better to simply check this on demand. That way we can just continuously improve the database instead of re-generating that list over and over again.

A rough idea (without thinking about it in detail) would be:

The itemDB contains the field relatedQuests, which is simply a list of quest IDs:

['relatedQuests'] = 15, -- table or nil, IDs of quests that are related to this item

That field could be checked for every quest item in the inventory and see if one of these quests is in the players quest log.

I think GetContainerItemQuestInfo can be used to check if an item is a quest item and QuestiePlayer.currentQuestlog[questId] should suffice for checking if a quest is in the players quest log.

commented

Instead of a delete, we could just tint the item in bag, and append something to the tooltip. Easy solution. But still need to generate that list of Quest Items + Related Quest(s) to do the check.

commented

Happy to do a PR, but can you point me towards where I can go to get the Quest Item + Related Quest(s) data? Is that something you could help me generate?

commented

Oh, that might not work, many many maaaaaaaaaaaaaaaaaaaaaaaaaany quest items don't have entry for relatedQuests

commented

Oh, that might not work, many many maaaaaaaaaaaaaaaaaaaaaaaaaany quest items don't have entry for relatedQuests

Yeah, I also fear as much. Might be something we can generate fixes for though.

  1. scrape list of quest items from wowhead
  2. check every quest and their item objectives
commented

It's Quest Items... Sure. That's easy. (=

https://www.wowhead.com/classic/items/quest

Quest Item example. It's easy to see, one at a time anyway, what quest the item is for. I assume there's a way to pull this in bulk.

These stupid spider legs... you always end up with more than you need and they just clutter your bag forever.

https://www.wowhead.com/classic/item=11725/solid-crystal-leg-shaft#objective-of
https://www.wowhead.com/classic/item=7846/crag-coyote-fang#objective-of
https://www.wowhead.com/classic/item=12219/unadorned-seal-of-ascension#objective-of

We would also want Items Provided for Quests. Which they don't seem to let you search for.

Here's an example. Anything provided for a quest can safely be tossed after the quest is completed.

https://www.wowhead.com/classic/item=1362/final-clue-to-sanders-treasure#provided-for
https://www.wowhead.com/classic/item=14544/lieutenants-insignia#provided-for

But wait there's more! (=

There are also "flavor" items that just sort of show up along the way, or can be randomly found different places.

Like these.

https://www.wowhead.com/classic/item=2154/the-story-of-morgan-ladimore
https://www.wowhead.com/classic/item=11108/faded-photograph
https://www.wowhead.com/classic/item=9279/white-punch-card

There are also items that are for multiple quests... most of the time these quests are gated Horde or Alliance flavors. So as long as all quests for your faction have been completed, it's fine to delete the item.

https://www.wowhead.com/classic/item=16991/triage-bandage

There are also items that start quests that you have either completed already (the item can drop again), or items that are not for your faction or class. (Not just "Can't Use" because you may just not be high enough level.)

https://www.wowhead.com/classic/quest=2945/grime-encrusted-ring
https://www.wowhead.com/classic/item=5103/washte-pawnes-feather

There are also a few items that you may want to sell... Just want to add a few "do not delete" examples to validate the data set later on. Since these aren't "Quest Items" we can likely just ignore them. (Or build a manual list of ignored items.)

https://www.wowhead.com/classic/item=4479/burning-charm
https://www.wowhead.com/classic/item=4611/blue-pearl

Anyway I have a good idea on the rules, but what I don't have is a SQL database to run the queries I want to run. =P

I'm pretty confident that WoWHead does have all the data we need... just a matter of being able to get it out. (=

commented

I suggest to start as small as possible and don't try to catch all of these cases at once.

When scrolling through the base "quest item" list on wowhead, there are a lot of false entries for this feature.

First of all I would start to go with these items: https://www.wowhead.com/classic/items/quest?filter=5:85:11;1:1:2;0:0:0
These are actual quest items (there is "Quest Item" in their tooltip).

That way all "objective of" and "provided for" items are caught, which have no other use like being sold on the AH.

  • "Flavor" items are a bit harder to get correct, therefore I would do that in a second step.
  • Items which start a quest can also be targeted afterwards, as it is quite clear they are of no use if the player already completed the quest.

Scraping wowhead surely is the harder way as you need to go from a list of items to each item individually to get the quest connection. And since wowhead limits results to 1000 entries, it's even harder. For SoD we have some manual steps to generate a list of IDs and then use our scraper to visit each site and go through the information (this is far from intuitive in some cases thanks to the way wowhead structures their data).

I think the easier way is to use the data Questie already has and just re-connect them, to make them more accessible.

Here is what I meant by "check every quest and their item objectives" and how I would tackle this:

  1. Install Lua
  2. Run lua cli/validate-era.lua (this compiles the DB and runs some validations against it)
  3. Modify this file
  4. Iterate over all quests (check the validations to see how)
  5. For each quest look for the following:
    a. Item objectives (list of item IDs)
    b. requiredSourceItems (list of item IDs)
    c. sourceItemId (single item ID)
  6. Build a list in the format of {[<itemId>]={<questId1>,<questId2>,...}}
  7. These list can then be used to generate corrections for the relatedQuests field
  8. (this check could become another validation step, to make sure future corrections always also sync the relatedQuests field)

That way the logic part can just use the relatedQuests as already explained above.

commented

I'll give this a go.