View Single Post
11-20-14, 02:43 PM   #9
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by thebdc View Post
I'm the author of the Compact Missions addon linked above, and that took me some time to figure out, too. So here's how it works:
  1. Get all completed missions with C_Garrison.GetCompleteMissions(). That returns a table of objects.
  2. For each entry in the table you have to call C_Garrison.MarkMissionComplete, with the missionID member of the object as the only parameter
  3. A event "GARRISON_MISSION_COMPLETE_RESPONSE" will be fired, which you have to handle. The only argument that comes with the event is the mission id
  4. When handling the above event, you have to call C_Garrison.CanOpenMissionChest, with the mission id as the only parameter. It returns true if the bonus chest can be opened
  5. If you can open the bonus chest you have to call C_Garrison.MissionBonusRoll, again with the mission id as the only parameter. That will fire the "GARRISON_MISSION_BONUS_ROLL_COMPLETE" event. You don't have to do anything with that one
I figured as much last night and got a few tests done. There are a few hiccups here and there which requires the code to be run multiple times to get everything done.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote