@@ -22,7 +22,7 @@ local LINE = ({
22
22
23
23
-- Register events
24
24
Addon .frame = CreateFrame (" Frame" )
25
- Addon .frame :SetScript (" OnEvent" , function (self , e , ...) Addon [e ](... ) end )
25
+ Addon .frame :SetScript (" OnEvent" , function (self , e , ...) Addon [e ](... ) end )
26
26
Addon .frame :RegisterEvent (" ADDON_LOADED" )
27
27
Addon .frame :RegisterEvent (" COMBAT_LOG_EVENT_UNFILTERED" )
28
28
@@ -50,30 +50,33 @@ function Addon.COMBAT_LOG_EVENT_UNFILTERED()
50
50
if not (info and details ) then return end
51
51
52
52
-- Check if it's a CC we are interested in
53
- if bit .band (info , PS .constants .CROWD_CTRL ) > 0 and bit .band (details , Addon .CC_TYPES ) > 0 then
54
- local npcId = Addon .GetNPCId (destGUID )
55
- if npcId and not Addon .immuneKnown [npcId ] then
56
- if event == " SPELL_AURA_APPLIED" then
57
- Addon .stunned [npcId ] = true
58
- Addon .immuneFound [npcId ] = nil
59
- elseif event == " SPELL_MISSED" and not Addon .stunned [npcId ] then
60
- Addon .immuneFound [npcId ] = true
61
- end
62
- end
53
+ if bit .band (info , PS .constants .CROWD_CTRL ) == 0 or bit .band (details , Addon .CC_TYPES ) == 0 then return end
54
+
55
+ -- Check if the NPC is valid and if we know its immunity yet
56
+ local npcId = Addon .GetNPCId (destGUID )
57
+ if not npcId then return end
58
+
59
+ if event == " SPELL_AURA_APPLIED" then
60
+ Addon .stunned [npcId ] = true
61
+ Addon .immuneFound [npcId ] = Addon .immuneKnown [npcId ] and false or nil
62
+ elseif event == " SPELL_MISSED" and not Addon .stunned [npcId ] then
63
+ Addon .immuneFound [npcId ] = true
63
64
end
64
65
end
65
66
66
67
-- Unit tooltip
67
- GameTooltip :HookScript (' OnTooltipSetUnit' , function (self )
68
- local name , unit = GameTooltip :GetUnit ()
69
- if unit or name then
70
- local guid = UnitGUID (unit or name )
71
- if guid then
72
- local npcId = Addon .GetNPCId (guid )
73
- if npcId and Addon .immuneFound [npcId ] or Addon .immuneKnown [npcId ] then
74
- GameTooltip :AddLine (LINE )
75
- end
76
- end
68
+ TooltipDataProcessor .AddTooltipPostCall (Enum .TooltipDataType .Unit , function (tooltip )
69
+ local name , unit = tooltip :GetUnit ()
70
+ if not (unit or name ) then return end
71
+
72
+ local guid = UnitGUID (unit or name )
73
+ if not guid then return end
74
+
75
+ local npcId = Addon .GetNPCId (guid )
76
+ if not npcId then return end
77
+
78
+ if Addon .immuneFound [npcId ] or Addon .immuneFound [npcId ] ~= false and Addon .immuneKnown [npcId ] then
79
+ tooltip :AddLine (LINE )
77
80
end
78
81
end )
79
82
@@ -432,6 +435,7 @@ Addon.immuneKnown = {
432
435
[118462 ] = true ,
433
436
[118523 ] = true ,
434
437
[118729 ] = true ,
438
+ [118791 ] = true ,
435
439
[119107 ] = true ,
436
440
[120019 ] = true ,
437
441
[120021 ] = true ,
@@ -886,6 +890,7 @@ Addon.immuneKnown = {
886
890
[154564 ] = true ,
887
891
[154565 ] = true ,
888
892
[154583 ] = true ,
893
+ [154586 ] = true ,
889
894
[154641 ] = true ,
890
895
[154727 ] = true ,
891
896
[154816 ] = true ,
@@ -1077,12 +1082,14 @@ Addon.immuneKnown = {
1077
1082
[166140 ] = true ,
1078
1083
[166142 ] = true ,
1079
1084
[166146 ] = true ,
1085
+ [166266 ] = true ,
1080
1086
[166393 ] = true ,
1081
1087
[166521 ] = true ,
1082
1088
[166644 ] = true ,
1083
1089
[166969 ] = true ,
1084
1090
[166970 ] = true ,
1085
1091
[167111 ] = true ,
1092
+ [167524 ] = true ,
1086
1093
[167527 ] = true ,
1087
1094
[167533 ] = true ,
1088
1095
[167534 ] = true ,
@@ -1113,6 +1120,7 @@ Addon.immuneKnown = {
1113
1120
[168934 ] = true ,
1114
1121
[168942 ] = true ,
1115
1122
[168973 ] = true ,
1123
+ [168988 ] = true ,
1116
1124
[169035 ] = true ,
1117
1125
[169102 ] = true ,
1118
1126
[169157 ] = true ,
@@ -1152,6 +1160,7 @@ Addon.immuneKnown = {
1152
1160
[173195 ] = true ,
1153
1161
[173276 ] = true ,
1154
1162
[173280 ] = true ,
1163
+ [173360 ] = true ,
1155
1164
[173444 ] = true ,
1156
1165
[173445 ] = true ,
1157
1166
[173446 ] = true ,
@@ -1181,4 +1190,6 @@ Addon.immuneKnown = {
1181
1190
[175877 ] = true ,
1182
1191
[175992 ] = true ,
1183
1192
[176173 ] = true ,
1184
- }
1193
+ [179472 ] = true ,
1194
+ [179760 ] = true ,
1195
+ }
0 commit comments