Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function(event, ...)
- -- cm timer start/stop
- if event == "WORLD_STATE_TIMER_START" then
- print(event)
- wa_cm_inprogress = true
- elseif event == "WORLD_STATE_TIMER_STOP" then
- wa_cm_inprogress = false
- print(event)
- -- pre timer(5 sec countdown)
- elseif event == "START_TIMER" then
- print(event)
- local dungeon, _, steps = C_Scenario.GetStepInfo()
- print(dungeon)
- print(steps)
- wa_cm_inprogress = true
- for i=1, steps do
- print(i)
- local name, _, status, _, value = C_Scenario.GetCriteriaInfo(i)
- print(name)
- print(status)
- print(value)
- wa_cm_obj_progress[i] = 0
- wa_cm_obj_name[i] = name
- wa_cm_obj_value[i] = value
- wa_cm_completion[i] = ""
- print(wa_cm_obj_name)
- print(wa_cm_obj_value)
- end
- -- on completed challenge mode
- elseif event == "CHALLENGE_MODE_COMPLETED" then
- print(event)
- for i=1, getn(wa_cm_obj_name) do
- if wa_cm_completion[i] == "" then
- wa_cm_obj_progress[i] = wa_cm_obj_value[i]
- wa_cm_completion[i] = ("- |c%s%s"):format("000ff000", wa_cm_time_current)
- end
- end
- wa_cm_inprogress = false
- -- on enter instance or login, get objectives
- elseif event == "ZONE_CHANGED_NEW_AREA" or event == "PLAYER_LOGIN" then
- print(event)
- local _, _, _, difficultyName = GetInstanceInfo()
- if difficultyName == "Challenge Mode" then
- -- hide blizzard challenge mode frame
- ObjectiveTrackerFrame:SetScript("OnEvent", nil)
- ObjectiveTrackerFrame:Hide()
- wa_cm_obj_progress = {}
- wa_cm_obj_name = {}
- wa_cm_obj_value = {}
- wa_cm_completion = {}
- local dungeon, _, steps = C_Scenario.GetStepInfo()
- if steps == 0 then
- wa_cm_inprogress = false
- else
- wa_cm_inprogress = true
- wa_cm_objective = true
- -- get objectives
- for i=1, steps do
- local name, _, status, _, value = C_Scenario.GetCriteriaInfo(i)
- wa_cm_obj_progress[i] = 1
- wa_cm_obj_name[i] = name
- wa_cm_obj_value[i] = value
- if status ~= true then
- wa_cm_completion[i] = ""
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement