Layback_ |
10-30-17 06:33 PM |
Any possible ways to obtain all order hall missions for each classes?
I could easily get all those available, in progress and complete missions with built in WoW APIs, but there seems to be no way to obtain all those order hall missions for each classes (including those missions which are currently not available or in CD).
Are those data stored in server side database, only?
Thank you!
-- EDIT #1
Quote:
I could easily get all those available, in progress and complete missions with built in WoW APIs, but ...
|
I was wrong.
Collecting those (available, in progress and complete missions) data were also not straight forward(?), as it seems like there's a slight delay on getting all data on first login.
The following those not insert data into a missions table.
Lua Code:
local f = CreateFrame("Frame"); f:RegisterEvent("PLAYER_ENTERING_WORLD"); f:SetScript("OnEvent", function(self, event, ...) if event == "PLAYER_ENTERING_WORLD" then if not IsAddOnLoaded("Blizzard_GarrisonUI") then LoadAddOn("Blizzard_GarrisonUI"); end local missions = {}; missions.available = GetAvailableMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0)); missions.inProgress = GetInProgressMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0)); missions.complete = GetCompleteMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0)); for state, missionList in pairs(missions) do for i = 1, #missionList do local mission = missionList[i]; mission.info = {GetMissionInfo(mission.missionID)}; end end _G["missions"] = missions; f:UnregisterEvent("PLAYER_ENTERING_WORLD"); end end);
Thus, I had to give it a x seconds of delay to give it a time to collect its data.
Lua Code:
local f = CreateFrame("Frame"); f:RegisterEvent("PLAYER_ENTERING_WORLD"); f:SetScript("OnEvent", function(self, event, ...) if event == "PLAYER_ENTERING_WORLD" then C_Timer.After(5, function() if not IsAddOnLoaded("Blizzard_GarrisonUI") then LoadAddOn("Blizzard_GarrisonUI"); end local missions = {}; missions.available = GetAvailableMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0)); missions.inProgress = GetInProgressMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0)); missions.complete = GetCompleteMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0)); for state, missionList in pairs(missions) do for i = 1, #missionList do local mission = missionList[i]; mission.info = {GetMissionInfo(mission.missionID)}; end end _G["missions"] = missions; f:UnregisterEvent("PLAYER_ENTERING_WORLD"); end); end end);
It worked okay, but I don't get why it needs a such delay :confused:
Would that be because it's getting all missions data from server?
|