Your looking for this:
Lua Code:
local function UpdateQuestInfo()
local allQuests, allCategories, seenCategories = QUEST_JOURNAL_MANAGER:GetQuestListData()
...
end
local OrigRefreshQuestMasterList = ZO_QuestJournal_Keyboard.RefreshQuestMasterList
function ZO_QuestJournal_Keyboard:RefreshQuestMasterList()
OrigRefreshQuestMasterList(self)
UpdateQuestInfo()
end
Here is an example of how to do it:
Warning: Spoiler
Lua Code:
-- will hold your quest info
local MyQuestInfo = {
categories = {},
seenCategories = {},
quests = {},
}
-- Used to add categories to your quest table
local function AddQuestCategory(name, type)
local category = {
name = name,
type = type,
}
MyQuestInfo.categories[name] = category
end
-- Used to add seen categories to your quest table
local function AddSeenCategory(name, seen)
if not MyQuestInfo.seenCategories[name] then
MyQuestInfo.seenCategories[name] = seen
end
end
-- add other parameters for everything else, or pass in a table with
-- quest info, this is just a hardcoded simple example
local function AddCustomQuest(categoryName)
local myQuest = {
name = "Test Quest",
questIndex = 473,
level = 49,
questType = 1,
categoryName = categoryName,
categoryType = 1,
questType = 0,
displayType = 0
}
MyQuestInfo.quests[myQuest.questIndex] = myQuest
end
-- adds your quests to the quest journal
local function AddMyQuestsToJournal()
local categories = MyQuestInfo.categories
local seenCategories = MyQuestInfo.seenCategories
local quests = MyQuestInfo.quests
for k,catTable in pairs(categories) do
table.insert(QUEST_JOURNAL_KEYBOARD.questMasterList.categories, catTable)
end
for k,seenCatTable in pairs(seenCategories) do
table.insert(QUEST_JOURNAL_KEYBOARD.questMasterList.seenCategories, seenCatTable)
end
for k,questTable in pairs(quests) do
table.insert(QUEST_JOURNAL_KEYBOARD.questMasterList.quests, questTable)
end
QUEST_JOURNAL_KEYBOARD:RefreshQuestList()
end
-- Just a test function to add some test quest
local function InitializeTestQuest()
local categoryName = "Test Cateogry"
-- Add this test quest to your quest table
AddQuestCategory(categoryName, 1)
AddSeenCategory(categoryName, true)
AddCustomQuest(categoryName)
-- manually call to update the journal since the journal
-- has already been populated
AddMyQuestsToJournal()
end
-- random do whatever you want/need here
-- if you need to inspect the quest journal quests, categories, seenCategories
-- you can get them here
-- Else just call AddMyQuestsToJournal() to add your quests to the journal
local function UpdateQuestInfo()
--local allQuests, allCategories, seenCategories = QUEST_JOURNAL_MANAGER:GetQuestListData()
AddMyQuestsToJournal()
end
local OrigRefreshQuestMasterList = ZO_QuestJournal_Keyboard.RefreshQuestMasterList
function ZO_QuestJournal_Keyboard:RefreshQuestMasterList()
OrigRefreshQuestMasterList(self)
-- If you need to do something to/with the quest journal quests, categories, seenCategories
-- call this & do it there
UpdateQuestInfo()
-- else you could just call this here instead
--AddMyQuestsToJournal()
end
The above code allows you to create quest categories and quests and add them to the journal, but as merlight said there are problems you might run into like MAX_JOURNAL_QUESTS & all of the quest functions that use any quest info like questIndex. You would probably have to hook all of them and handle them yourself or you would probably crash any addon that works with quests. Also who knows what trouble you might run into if ZOS code runs some private functions or something server side and attempts to use your fake questIndex or any of your other fake quest info.