I've never seen this question answered before. I've seen multiple people attempt to answer it, but from what I've found, none of them are correct.
The first suggesstion from the very own Jadd is to use these two functions:
CGQuestObjectiveCache::ObjectTrackedInQuest
CGQuestObjectiveCache::CreatureTrackedInQuest
However, I've noticed that ObjectTrackedInQuest DOES NOT work for things like GO_TYPE_CHEST. Take a look at the quest cache entry below for the quest :
Assault on the Vestibule - Quest - World of Warcraft
This item requires the item Weak Anima Mote - Item - World of Warcraft
That item is looted from this TYPE_CHEST gameobject:
Depleted Anima Canister - Object - World of Warcraft
However, the QuestCache DOES NOT save the object value, instead it simply saves the required item (172451)
------------------------------------
In the GameObjectCache, another suggestion to find tracked quest objects, we can find:
Which contains the objectId, and a string saying "questinteract". The game however does not populate the questId field of ChestGameObjectData, TrinityCore marks that it's unused, so that's a no-go as well. There is no link back to the Quest, so the GameObjectCache knows it's a quest interaction object, but doesn't actually know which quest it's tied to.
So it's neither QuestCache nor GameObjectCache. This includes the functions I mentioned above which check the QuestObjectiveCache. The quest objective cache only has the item the container contains.
------------------------------------
Both the tooltip AND the renderer knows that this is a quest object. It applies a outline/glow effect AND populates the tooltip with the quest related information. The question is HOW. How does it retrieve quest object information for this specific object. It doesn't appear to be QuestObjectiveCache, GameObjectCache, or QuestCache.
TrinityCore searches it's LootManager and iterates through LootTemplates to determine if a chest/container has quest loot:
They don't check any flags or game object values, instead stick solely to the loottemplate, so I'm really not sure if there is anywhere we can find this via the gameobject itself.Code:bool LootStore::HaveQuestLootFor(uint32 loot_id) const { LootTemplateMap::const_iterator itr = m_LootTemplates.find(loot_id); if (itr == m_LootTemplates.end()) return false; // scan loot for quest items return itr->second->HasQuestDrop(m_LootTemplates); } bool LootStore::HaveQuestLootForPlayer(uint32 loot_id, Player const* player) const { LootTemplateMap::const_iterator tab = m_LootTemplates.find(loot_id); if (tab != m_LootTemplates.end()) if (tab->second->HasQuestDropForPlayer(m_LootTemplates, player)) return true; return false; }
So that leaves me to think I need to find either how the tooltip is populated with quest information for a object (TooltipDataProvider I believe) OR how the game determines it should outline an object. I tried poking around in Ida to see how the game handles the OutlineMode cvar, and I did eventually come across something related to C_Player and OutLineMode (likely the self/player outline for "findingyourself"), but wasn't able to find anything related to quests or gameobject.
Has anyone ever figured this out? I know I can just scan tooltips in lua, but that's stupid for what I'm trying to do, and has expensive overhead. I want to call the function that gives the tooltip the quest information for that object. I can't find any function for this. I had thought the ones Jadd posted would be good enough (the CGQuestObjectiveCache ones), and they mostly work, but not for all objects sadly.