Logo

index : nswa

WoW addon which removes annoyances and adds QoL (for me)

  • summary
  • about
  • tree
  • log
  • branches
<< path: root/public/nswa.git/html/nswa_dungeon_difficulty.lua blob: ba44a5b9a146595ab8fb91fb4d735c17e9d7c5af [raw] [clear marker]

        
0
1
2local already_warned = false
3
4
5local function check_dungeon_difficulty()
6 if IsInRaid() then return end
7 if not IsInGroup() then return end
8 if already_warned then return end
9
10 local difficulty_id = GetDungeonDifficultyID()
11
12 -- 23 = Mythic
13 if difficulty_id ~= 23 then
14 local text = "[Alert]: Dungeon difficulty is currently not set to Mythic."
15 print("NSWA: " .. text)
16 SendChatMessage(text, "PARTY")
17 already_warned = true
18 end
19end
20
21local function delayed_check()
22 C_Timer.After(1, function()
23 check_dungeon_difficulty()
24 end)
25end
26
27local function reset_state()
28 already_warned = false
29end
30
31local frame = CreateFrame("Frame")
32
33frame:RegisterEvent("GROUP_ROSTER_UPDATE")
34frame:RegisterEvent("PLAYER_ENTERING_WORLD")
35
36frame:SetScript("OnEvent", function(self, event)
37 if event == "GROUP_ROSTER_UPDATE" then
38 if not IsInGroup() then
39 reset_state()
40 else
41 delayed_check()
42 end
43 elseif event == "PLAYER_ENTERING_WORLD" then
44 delayed_check()
45 end
46end)
47
48
Copyright 2026  E766CB298A6D1E64 | Git-Thing heavily inspired by cgit