Questie

Questie

116M Downloads

Leverage Questie for another addon - Quest NPC finder

wheezy1749 opened this issue ยท 8 comments

commented

Hello, I was doing some digging trying to add a feature/addon to wow and leverage the Questie database to do it. Though, I'm stuck in my idea and could use some info.

First my addon idea: I often find myself looking for an NPC in a quest that is "unique" meaning it only ever has a single instance of that NPC in the world at a time. Think named mobs like Hogger. I usually either resort to /tar or adding its ID or name to a rare tracker addon. However, I was hoping to automate this when I am on a specific quest. Basically automatically add that NPC id to a raretracker like addon if I've not killed/looted the item yet. Then I don't have to /tar manually or add the name to my raretracker and remove it later. The addon would just do all that automatically when I'm on that quest.

I started looking in "classicNpcDB.lua" and was going to try to leverage attributes from here to create my addon but I can't seem to find any attribute in there or in the mangos-classic typedefs that have any info about whether a specific NPC is "unique" or not. I would like to create my own database of these "unique" npcs that are in quests but I'm having a hard time finding a list of them.

WoWhead doesn't really tell you if the NPC is unique and it has a list of "rares" but these are not the same as just named mobs. Not sure if I can leverage Questie info for this. Cross reference Npc and Quest databases to make this list? Not sure if this is the right place to ask this kind of question but I don't know where else to get this info. Pretty new to addons (though I'm a software dev for my job) thanks for your time.

commented

Hey there,

Sounds like an interesting idea and I am happy to help as good as I can :)

First things first. You can use the QuestieDB ingame to read NPC information like this:

/dump QuestieDB:GetNPC(<npcId>) (Questie Debug setting active)

in your addon (or ingame without Debug active) you should use:

QuestieLoader:ImportModule("QuestieDB"):GetNPC(<npcId>). You can also assign the value of QuestieLoader:ImportModule("QuestieDB") to a variable before.

I think what you are looking for are NPC which just have one spawn location meaning they are "unique".

NPCs have a spawns property. This is a table containing a table of zoneId -> spawn location mappings:

{
  [<zoneId>] = {
    [1] = {spawnX, spawnY},
    [2] = {spawnX, spawnY},
    ...
  },
  ...
}

The quest database can be used in the same way: /dump QuestieDB:GetQuest(<questId>).

Hopefully this helps you on your first steps using the Questie database.

commented

Thank you! That's a great start for me. I did think about the "only one spawn" idea and I think that should get me a large chunk of those types of "unique" mobs. However, there are "unique" mobs with multiple spawn locations that I'd like to include as well.

For example, Miner Hackett

Although, it looks like even though he has multiple spawn points on wowhead the database file only lists one.

{'Miner Hackett',950,950,29,29,0,{[267]={{31.12,58.63},},},nil,267,nil,nil,88,"A",nil,0,},

Can I assume that for all of these "unique" guys? I really don't care about knowing the spawn points exactly. Just if they are unique or not. Since I don't want my addon warning me everytime it sees a mob I need (just the unique ones that are harder to find or need to wait for).

Appreciate the response!

commented

Hmmm yeah you are right, there are unique mobs with multiple possible spawns. Miner Hackett is one of them even though the QuestieDB is wrong at this point. Even the corrections you can find in the Corrections folder doesn't fix this NPC right ๐Ÿ™ˆ

So the "one spawn" idea will miss some NPCs.

There is also the "rank" of an NPC which has these values according to cmangos:

grafik

I wonder if it is enough to check if an NPC has like "not more than 3 spawns" or something ๐Ÿค”

commented

Only having one spawn might be a misleading indicator though, some "unique" NPCs might have multiple possible spawns in our DB like your example from Wowhead, or no spawns at all because they are spawned by a script on Cmangos. So take it with a grain of salt. A useful one might be when you have a kill objective on a quest (i.e. type creature and no text) with objective count 1, you probably have a relatively scarce or even unique NPC.

P.S.: Not to say that creature objectives with a text are uninteresting, they are just a special case (by the way these ObjectiveText1 through ObjectiveText4 fields are not to be confused with the Objectives text field).

commented

Could be possible to do it based on lower number of spawn locations. I may try writing a script that goes through them all checking for lower spawn numbers and see how large the list is and if its manually parse-able to just check names after that point. Thanks a lot for the input! I guess the final answer is "no there is no such property". So, for this and so I'm gonna have to be the first person to tag NPCs with this "uniqueness" attribute. Thanks for giving me some ideas on how to filter them.

commented

Thank you. I started looking into doing that but I can't seem to figure out where I get the "count" of slain enemies or the count of items from. I decided to get all single kill and single quest item requirements and then eliminate corner cases manually. With additionally filtering the npc by level range (unique npcs will have a min_lvl == max_lvl) so that should help with a little bit more filtering.

However, I don't think I understand how the kill/item count is listed.

For example

[190] = {"Panther Mastery",{{718,},nil,nil,},{{718,},nil,},28,31,255,nil,{"Sir S. J. Erlgadin of Nesingwary's Expedition wants you to kill 10 Young Panthers.",},nil,{{{683,nil},},nil,nil,nil,},nil,nil,{583,},nil,nil,nil,33,nil,nil,nil,nil,191,8,nil,nil,},

I'm not sure where the 10 kills come from apart from the description string. Which I don't think is what I should be relying on?

Also, is the corrected version of the database built every time wow is launched? I've mostly just been looking at leveraging the existing classicQuestDB.lua etc files. Is the corrected version built as a file somewhere or does it only exist in volatile memory during each launch of wow? Sorry, new to this and the code is a little hard to break down. Should I be focusing on building my own database directly using CMangos instead of Questie?

Thanks.

commented

You get additional information about a quest from the official Blizzard API. C_QuestLog.GetQuestObjectives(questId) is returns a table of the objectives which also includes the amount you need to fulfill an objective.

About the corrected database: It is not only in volatile memory, but in an unreadable format in the Saved Variables. On every Questie update or when manually recompiling the database, all of the corrections (tbcQuestFixes.lua e.g.) are read and combined with the base database files (tbcQuestDB.lua e.g.).

I am not really familiar with CMangos, but I think the Questie database is easier to use as it is already accessible in the game for you. You can write a little script in your addon which collects the NPC IDs relevant for you and once you are happy with the ones you found you can store them in your addon instead of generating them on every load by querying the Questie database.

commented

Just wanted to let you know I wrote a small summary on how to use our code the other day. Doesn't have much more info then what BreakBB said above, but it's on topic, so here it is.

Also if you are interested in getting only the data you want in the format you need, you could try to adapt our extractor. Using it requires a full Cmangos setup of both Classic and TBC, but if that isn't too involved for you then writing an output function specific to your use case should be relatively simple. And it has data on objective count, so you could filter that.

Feel free to access our DB from your addon though. My heart always jumps a bit when I hear people do that, think it's really cool. The better WoW API. ๐Ÿ˜„

Going to close this issue, since it seems to have run its course for now.

Feel free to contact us on Discord (or re-open here) if you have any more questions!