Advertisement
Guest User

Untitled

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