View Single Post
11-20-14, 04:10 AM   #8
thebdc
A Murloc Raider
Join Date: Mar 2011
Posts: 5
Originally Posted by SDPhantom View Post
Currently, I'm trying to write code for the missions to automatically claim rewards and turn in. With none of the Garrison API documented yet, it's proven a challenge, but I'm making some headway into getting it working. It's bugged me since beta that they're forcing us to wait for animations to play through in order to do so.
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 envent, 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
  Reply With Quote