Ordering of quest objectives
max-ri opened this issue ยท 3 comments
It would be great if there was a way to query quest objectives in a way so that we also get information in which order they will appear in game when there is more than one objective.
The background of this unusual feature request: I am the developer of the leveling addon Guidelime. Many of my users have requested, that it would be nice to be able to use ClassicCodex as the quest database for the addon. Currently for this purpose Questie is a dependency. To me it seems it would be very well possible to use this excellent addon as a data source instead. Right now above issue seems to be the only thing which is in the way.
Here is an example:
The quest https://tbc.wowhead.com/quest=9761/clearing-the-way has two objectives.
When querying CodexDB.quests.data[9761].obj.U I can access the npc ids: {17609,17610}. But currently I do not see a way to get the information that actually the second id in the array corresponds to the first objective of the quest. (The order of the objectives shown on wowhead always is the same as it is in game, as well as e.g. used in functions like GetQuestLogLeaderBoard.)
Easiest solution would be if the array would respect the order e.g. {17610,17609} in above example. But this would be problematic when more than one id correspond to the same objective. As in https://tbc.wowhead.com/quest=10482/fel-orc-scavengers (new type of quests added in tbc). Maybe an additional array CodexDB.quests.data[x].obj.order or something like that could be added. Whatever would be easiest to implement.
Feel free to ignore my request. I would be very thankful if it could be realized.
Cheers, Borick
How do you find this ordering information from Questie?
In fact, ClassicCodex has been synchronizing quest data from Questie recently (see https://github.com/SwimmingTiger/MergeQuestieToCodexDB). So if the data exists in Questie, I can copy it to ClassicCodex.
Thank you for your quick answer!
With Questie I get:
QuestieDB:GetQuest(9761).objectives[1] = {{17610},{17609}}
So when there is more than one objective of one type they are given in a certain order.
For the other example where multiple npc ids are used for a single objective, Questie uses a different (new) objective type "killCredit". So QuestieDB:GetQuest(10482).objectives[1] is empty and instead QuestieDB:GetQuest(10482).objectives[5] contains the list of ids.
(If there are multiple objectives of different objective types it is assumed these are always in a fixed order: 1.creature / 2.object / 3.item / 4.reputation / 5.killCredit. So far I have not had issues with this. But more testing is required.)
From looking at the code you linked, I do not see where the different order should be coming from. Looks like npc id should be listed in the same order as in Questie when they are imported.
Another example where the order in ClassicCodex is different is https://tbc.wowhead.com/quest=9669/the-missing-expedition.