Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. WORLD_STATE_TIMER_STOP WORLD_STATE_TIMER_START CHALLENGE_MODE_COMPLETED START_TIMER ZONE_CHANGED_NEW_AREA PLAYER_LOGIN
  2.  
  3.  
  4. function(event, ...)
  5.  
  6. -- cm timer start/stop
  7. if event == "WORLD_STATE_TIMER_START" then
  8. print(event)
  9. wa_cm_inprogress = true
  10. elseif event == "WORLD_STATE_TIMER_STOP" then
  11. wa_cm_inprogress = false
  12. print(event)
  13.  
  14. -- pre timer(5 sec countdown)
  15. elseif event == "START_TIMER" then
  16. print(event)
  17.  
  18. local dungeon, _, steps = C_Scenario.GetStepInfo()
  19. wa_cm_inprogress = true
  20. for i=1, steps do
  21. local name, _, status, _, value = C_Scenario.GetCriteriaInfo(i)
  22. wa_cm_obj_progress[i] = 0
  23. wa_cm_obj_name[i] = name
  24. wa_cm_obj_value[i] = value
  25. wa_cm_completion[i] = ""
  26.  
  27. print(wa_cm_obj_name)
  28. print(wa_cm_obj_value)
  29. end
  30.  
  31. -- on completed challenge mode
  32. elseif event == "CHALLENGE_MODE_COMPLETED" then
  33. print(event)
  34.  
  35. for i=1, getn(wa_cm_obj_name) do
  36. if wa_cm_completion[i] == "" then
  37. wa_cm_obj_progress[i] = wa_cm_obj_value[i]
  38. wa_cm_completion[i] = ("- |c%s%s"):format("000ff000", wa_cm_time_current)
  39. end
  40.  
  41. end
  42. wa_cm_inprogress = false
  43.  
  44. -- on enter instance or login, get objectives
  45. elseif event == "ZONE_CHANGED_NEW_AREA" or event == "PLAYER_LOGIN" then
  46. print(event)
  47.  
  48. local _, _, _, difficultyName = GetInstanceInfo()
  49. if difficultyName == "Challenge Mode" then
  50. -- hide blizzard challenge mode frame
  51. ObjectiveTrackerFrame:SetScript("OnEvent", nil)
  52. ObjectiveTrackerFrame:Hide()
  53.  
  54. wa_cm_obj_progress = {}
  55. wa_cm_obj_name = {}
  56. wa_cm_obj_value = {}
  57. wa_cm_completion = {}
  58. local dungeon, _, steps = C_Scenario.GetStepInfo()
  59. if steps == 0 then
  60. wa_cm_inprogress = false
  61. else
  62. wa_cm_inprogress = true
  63. wa_cm_objective = true
  64. -- get objectives
  65. for i=1, steps do
  66. local name, _, status, _, value = C_Scenario.GetCriteriaInfo(i)
  67. wa_cm_obj_progress[i] = 1
  68. wa_cm_obj_name[i] = name
  69. wa_cm_obj_value[i] = value
  70. if status ~= true then
  71. wa_cm_completion[i] = ""
  72. end
  73. end
  74. end
  75. end
  76. end
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement