Thread Tools Display Modes
10-30-17, 06:33 PM   #1
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
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

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:
  1. local f = CreateFrame("Frame");
  2. f:RegisterEvent("PLAYER_ENTERING_WORLD");
  3. f:SetScript("OnEvent", function(self, event, ...)
  4.     if event == "PLAYER_ENTERING_WORLD" then
  5.         if not IsAddOnLoaded("Blizzard_GarrisonUI") then
  6.             LoadAddOn("Blizzard_GarrisonUI");
  7.         end
  8.  
  9.         local missions = {};
  10.         missions.available = GetAvailableMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  11.         missions.inProgress = GetInProgressMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  12.         missions.complete = GetCompleteMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  13.  
  14.         for state, missionList in pairs(missions) do
  15.             for i = 1, #missionList do
  16.                 local mission = missionList[i];
  17.  
  18.                 mission.info = {GetMissionInfo(mission.missionID)};
  19.             end
  20.         end
  21.  
  22.         _G["missions"] = missions;
  23.  
  24.         f:UnregisterEvent("PLAYER_ENTERING_WORLD");
  25.     end
  26. end);

Thus, I had to give it a x seconds of delay to give it a time to collect its data.

Lua Code:
  1. local f = CreateFrame("Frame");
  2. f:RegisterEvent("PLAYER_ENTERING_WORLD");
  3. f:SetScript("OnEvent", function(self, event, ...)
  4.     if event == "PLAYER_ENTERING_WORLD" then
  5.         C_Timer.After(5, function()
  6.             if not IsAddOnLoaded("Blizzard_GarrisonUI") then
  7.                 LoadAddOn("Blizzard_GarrisonUI");
  8.             end
  9.  
  10.             local missions = {};
  11.             missions.available = GetAvailableMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  12.             missions.inProgress = GetInProgressMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  13.             missions.complete = GetCompleteMissions(GetPrimaryGarrisonFollowerType(LE_GARRISON_TYPE_7_0));
  14.  
  15.             for state, missionList in pairs(missions) do
  16.                 for i = 1, #missionList do
  17.                     local mission = missionList[i];
  18.  
  19.                     mission.info = {GetMissionInfo(mission.missionID)};
  20.                 end
  21.             end
  22.  
  23.             _G["missions"] = missions;
  24.  
  25.             f:UnregisterEvent("PLAYER_ENTERING_WORLD");
  26.         end);
  27.     end
  28. end);

It worked okay, but I don't get why it needs a such delay

Would that be because it's getting all missions data from server?

Last edited by Layback_ : 10-30-17 at 09:57 PM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Any possible ways to obtain all order hall missions for each classes?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off