-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHMUtil.lua
762 lines (659 loc) · 20.9 KB
/
HMUtil.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
-- Contains standalone utility functions that cause no side effects and don't require data from other files, other than the unit proxy
HMUtil = {}
local _G = getfenv(0)
setmetatable(HMUtil, {__index = getfenv(1)})
setfenv(1, HMUtil)
Classes = {"WARRIOR", "PALADIN", "HUNTER", "ROGUE", "PRIEST", "SHAMAN", "MAGE", "WARLOCK", "DRUID"}
HealerClasses = {"PRIEST", "DRUID", "SHAMAN", "PALADIN"}
UnitXPSP3 = pcall(UnitXP, "inSight", "player", "player") -- WTB better way to check for UnitXP SP3
UnitXPSP3_Version = -1
if UnitXPSP3 and pcall(UnitXP, "version", "coffTimeDateStamp") then
UnitXPSP3_Version = UnitXP("version", "coffTimeDateStamp") or -1
end
SuperWoW = SpellInfo ~= nil
Nampower = QueueSpellByName ~= nil
TurtleWow = true
PowerColors = {
["mana"] = {0.1, 0.25, 1}, --{r = 0, g = 0, b = 0.882}, Not accurate, changed color to make brighter
["rage"] = {1, 0, 0},
["focus"] = {1, 0.5, 0.25},
["energy"] = {1, 1, 0}
}
ClassPowerTypes = {
["WARRIOR"] = "rage",
["PALADIN"] = "mana",
["HUNTER"] = "mana",
["ROGUE"] = "energy",
["PRIEST"] = "mana",
["SHAMAN"] = "mana",
["MAGE"] = "mana",
["WARLOCK"] = "mana",
["DRUID"] = "mana"
}
-- The power types IDs mapped in accordance to UnitPowerType
PowerTypeMap = {
[0] = "mana",
[1] = "rage",
[2] = "focus",
[3] = "energy"
}
-- The default color Blizzard uses for text
DefaultTextColor = {1, 0.82, 0}
PartyUnits = {"player", "party1", "party2", "party3", "party4"}
PetUnits = {"pet", "partypet1", "partypet2", "partypet3", "partypet4"}
TargetUnits = {"target"}
RaidUnits = {}
for i = 1, MAX_RAID_MEMBERS do
RaidUnits[i] = "raid"..i
end
RaidPetUnits = {}
for i = 1, MAX_RAID_MEMBERS do
RaidPetUnits[i] = "raidpet"..i
end
CustomUnits = HMUnitProxy and HMUnitProxy.AllCustomUnits or {}
CustomUnitsSet = HMUnitProxy and HMUnitProxy.AllCustomUnitsSet or {}
FocusUnits = HMUnitProxy and HMUnitProxy.CustomUnitsMap["focus"] or {}
if HMUnitProxy then
HMUnitProxy.ImportFunctions(HMUtil)
end
local unitArrays = {PartyUnits, PetUnits, RaidUnits, RaidPetUnits, TargetUnits}
AllUnits = {}
for _, unitArray in ipairs(unitArrays) do
for _, unit in ipairs(unitArray) do
table.insert(AllUnits, unit)
end
end
AllRealUnits = {}
for i, unit in ipairs(AllUnits) do
AllRealUnits[i] = unit
end
if HMUnitProxy then
for _, unit in ipairs(CustomUnits) do
table.insert(AllUnits, unit)
end
HMUnitProxy.RegisterUpdateListener(function()
local i = 1
for _, unit in ipairs(AllRealUnits) do
AllUnits[i] = unit
i = i + 1
end
for _, unit in ipairs(CustomUnits) do
AllUnits[i] = unit
i = i + 1
end
ClearTable(AllUnitsSet)
for k, v in pairs(ToSet(AllUnits)) do
AllUnitsSet[k] = v
end
end)
end
local assetsPath = "Interface\\AddOns\\HealersMate\\assets\\"
function GetAssetsPath()
return assetsPath
end
-- Returns a new table with the elements of the given array being the keys with 1 being the value of all keys,
-- or the index if indexValue is true
function ToSet(array, indexValue)
local set = {}
for index, value in ipairs(array) do
set[value] = indexValue and index or 1
end
return set
end
-- Returns a new table with the keys of the given set being the values of the array
function ToArray(set)
local array = {}
for value, _ in pairs(set) do
table.insert(array, value)
end
return array
end
-- Adds the elements of otherArray to the array
function AppendArrayElements(array, otherArray)
for _, v in ipairs(otherArray) do
table.insert(array, v)
end
end
function IndexOf(table, value)
for i, v in ipairs(table) do
if v == value then
return i
end
end
return -1
end
function ArrayContains(table, value)
for _, v in ipairs(table) do
if v == value then
return true
end
end
return false
end
function RemoveElement(t, value)
table.remove(t, IndexOf(t, value))
end
function CloneTable(table, deep)
local clone = {}
for k, v in pairs(table) do
if deep and type(v) == "table" then
clone[k] = CloneTable(v, true)
else
clone[k] = v
end
end
return clone
end
local compost = AceLibrary("Compost-2.0")
function CloneTableCompost(t, deep)
local clone = compost:GetTable()
local n = 0
for k, v in pairs(t) do
if deep and type(v) == "table" then
clone[k] = CloneTableCompost(v, true)
else
clone[k] = v
end
n = n + 1
end
table.setn(clone, n)
return clone
end
function ClearTable(table)
for k, v in pairs(table) do
table[k] = nil
end
end
-- Courtesy of ChatGPT
function SplitString(str, delimiter)
local result = {}
local start_pos = 1
while true do
local end_pos = string.find(str, delimiter, start_pos)
if not end_pos then
table.insert(result, string.sub(str, start_pos))
break
end
table.insert(result, string.sub(str, start_pos, end_pos - 1))
start_pos = end_pos + string.len(delimiter)
end
return result
end
function StartsWith(str, starts)
return string.sub(str, 1, string.len(starts)) == starts
end
function RoundNumber(number, decimalPlaces)
decimalPlaces = decimalPlaces or 0
return math.floor(number * 10^decimalPlaces + 0.5) / 10^decimalPlaces
end
-- Courtesy of ChatGPT
function InterpolateColors(colors, t)
local r, g, b = InterpolateColorsNoTable(colors, t)
return {r, g, b}
end
function InterpolateColorsNoTable(colors, t)
local numColors = table.getn(colors)
-- Ensure t is between 0 and 1
t = math.max(0, math.min(1, t))
-- If there are fewer than 2 colors, just return the single color
if numColors < 2 then
local c = colors[1]
return c[1], c[2], c[3]
end
-- Determine the segment in which t falls
local scaledT = t * (numColors - 1) -- Scale t to cover the range of indices
local index = math.floor(scaledT)
local fraction = scaledT - index
-- Handle edge cases where index is out of bounds
if index >= numColors - 1 then
local c = colors[numColors]
return c[1], c[2], c[3]
end
local color1 = colors[index + 1]
local color2 = colors[index + 2]
-- Linear interpolation between color1 and color2
local r = color1[1] + (color2[1] - color1[1]) * fraction
local g = color1[2] + (color2[2] - color1[2]) * fraction
local b = color1[3] + (color2[3] - color1[3]) * fraction
return r, g, b
end
function Colorize(text, r, g, b)
if type(r) == "table" then
local rgb = r
r = rgb[1]
g = rgb[2]
b = rgb[3]
end
return "|cFF" .. string.format("%02x%02x%02x", r * 255, g * 255, b * 255) .. text .. "|r"
end
function StripColors(text)
text = string.gsub(text, "|c%x%x%x%x%x%x%x%x", "")
text = string.gsub(text, "|r", "")
return text
end
local coloredRoles = {
["Tank"] = Colorize("Tank", 0.3, 0.6, 1),
["Healer"] = Colorize("Healer", 0.2, 1, 0.2),
["Damage"] = Colorize("Damage", 1, 0.4, 0.4),
["No Role"] = "No Role"
}
function GetColoredRoleText(role)
if not role then
return coloredRoles["No Role"]
end
return coloredRoles[role]
end
-- Deprecated
function IsFeigning(unit)
local unitClass = GetClass(unit)
if unitClass == "HUNTER" then
local superwow = IsSuperWowPresent()
for i = 1, 32 do
local texture, _, id = UnitBuff(unit, i)
if superwow then -- Use the ID if SuperWoW is present
if id == 5384 then -- 5384 is Feign Death
return true
end
else -- Use the texture otherwise
if texture == "Interface\\Icons\\Ability_Rogue_FeignDeath" then
return true
end
end
end
end
return false
end
function HasAura(unit, auraType, auraTexture, auraID)
local auraFunc = auraType == "Buff" and UnitBuff or UnitDebuff
local checkCount = auraType == "Buff" and 32 or 16
local superwow = IsSuperWowPresent()
for i = 1, checkCount do
local texture, _, id = auraFunc(unit, i)
if superwow and auraID then
if auraID == id then
return true
end
else
if texture == auraTexture then
return true
end
end
end
return false
end
function GetBagSlotInfo(bag, slot)
local link = GetContainerItemLink(bag, slot)
if not link then
return
end
local _, _, name = string.find(link, "%[(.*)%]")
local _, count = GetContainerItemInfo(bag, slot)
return name, count
end
-- Returns: Bag index, Slot index
function FindBagSlot(itemName)
local bestBag, bestSlot, lowestStackSize
for bag = 0, NUM_BAG_FRAMES do
for slot = 1, GetContainerNumSlots(bag) do
local name, count = GetBagSlotInfo(bag, slot)
if itemName == name then
if not lowestStackSize or lowestStackSize > count then
bestBag = bag
bestSlot = slot
lowestStackSize = count
end
end
end
end
return bestBag, bestSlot
end
-- Returns true if an item was found and attempted to be used
function UseItem(itemName)
local bag, slot = FindBagSlot(itemName)
if not bag then
return
end
UseContainerItem(bag, slot)
return true
end
function GetItemCount(itemName)
local total = 0
for bag = 0, NUM_BAG_FRAMES do
for slot = 1, GetContainerNumSlots(bag) do
local name, count = GetBagSlotInfo(bag, slot)
if itemName == name then
total = total + count
end
end
end
return total
end
-- Returns an array of the units in the party number or the unit's raid group
function GetRaidPartyMembers(partyNumberOrUnit)
if not RAID_SUBGROUP_LISTS then
return compost:GetTable()
end
if type(partyNumberOrUnit) == "string" then
partyNumberOrUnit = FindUnitRaidGroup(partyNumberOrUnit)
end
local members = {}
if RAID_SUBGROUP_LISTS[partyNumberOrUnit] then
for frameNumber, raidNumber in pairs(RAID_SUBGROUP_LISTS[partyNumberOrUnit]) do
table.insert(members, RaidUnits[raidNumber])
end
end
return members
end
-- Returns the raid unit that this unit is, or nil if the unit is not in the raid
function FindRaidUnit(unit)
if not RAID_SUBGROUP_LISTS then
return nil
end
for party = 1, 8 do
if RAID_SUBGROUP_LISTS[party] then
for frameNumber, raidNumber in pairs(RAID_SUBGROUP_LISTS[party]) do
local raidUnit = RaidUnits[raidNumber]
if UnitIsUnit(unit, raidUnit) then
return raidUnit
end
end
end
end
end
-- Returns the raid group number the unit is part of, or nil if the unit is not in the raid
function FindUnitRaidGroup(unit)
for party = 1, 8 do
if RAID_SUBGROUP_LISTS[party] then
for frameNumber, raidNumber in pairs(RAID_SUBGROUP_LISTS[party]) do
local raidUnit = RaidUnits[raidNumber]
if UnitIsUnit(unit, raidUnit) then
return party
end
end
end
end
end
-- Requires SuperWoW
function GetSurroundingPartyMembers(player, range)
local units
if UnitInRaid("player") then
units = GetRaidPartyMembers(player)
else
units = CloneTableCompost(PartyUnits)
AppendArrayElements(units, PetUnits)
end
return GetUnitsInRange(player, units, range or 30)
end
function GetSurroundingRaidMembers(player, range, checkPets)
local units
if UnitInRaid("player") then
units = CloneTableCompost(RaidUnits)
if checkPets then
AppendArrayElements(units, RaidPetUnits)
end
else
units = CloneTableCompost(PartyUnits)
if checkPets then
AppendArrayElements(units, PetUnits)
end
end
return GetUnitsInRange(player, units, range or 30)
end
function GetUnitsInRange(center, units, range)
local inRange = compost:GetTable()
for _, unit in ipairs(units) do
local exists, guid = UnitExists(unit)
if exists and UnitIsConnected(unit) and not UnitIsDeadOrGhost(unit) and
GetDistanceBetween(center, unit) <= (range or 30) then
table.insert(inRange, guid)
end
end
return inRange
end
-- Blizzard's UI functions seem to get called referring to a global called "this" referring to the UI object.
-- This function calls a function on the object, emulating the "this" variable.
function CallWithThis(object, func)
local prevThis = _G.this
_G.this = object
func()
_G.this = prevThis
end
-- Returns the class without the first return variable fluff
function GetClass(unit)
local _, class = UnitClass(unit)
return class
end
function GetClasses()
return Classes
end
function GetRandomClass()
return Classes[math.random(1, 9)]
end
local healerClassesSet = ToSet(HealerClasses)
function IsHealerClass(unit)
return healerClassesSet[GetClass(unit)] == 1
end
local classColors = {
["DRUID"] = {1.0, 0.49, 0.04},
["HUNTER"] = {0.67, 0.83, 0.45},
["MAGE"] = {0.41, 0.8, 0.94},
["PALADIN"] = {0.96, 0.55, 0.73},
["PRIEST"] = {1.0, 1.0, 1.0},
["ROGUE"] = {1.0, 0.96, 0.41},
["SHAMAN"] = {0.14, 0.35, 1.0},
["WARLOCK"] = {0.58, 0.51, 0.79},
["WARRIOR"] = {0.78, 0.61, 0.43}
}
function GetClassColor(class, asArray)
local color = classColors[class]
if not color then -- Unknown class
color = {0.7, 0.7, 0.7}
end
if asArray then
return color
end
return color[1], color[2], color[3]
end
-- Checks for feign death as well
function IsDeadFriend(unit)
return (UnitIsDead(unit) or UnitIsCorpse(unit)) and UnitIsFriend("player", unit) and not IsFeigning(unit)
end
local keyModifiers = {"None", "Shift", "Control", "Alt", "Shift+Control", "Shift+Alt", "Control+Alt", "Shift+Control+Alt"}
function GetKeyModifiers()
return keyModifiers
end
-- L1: Shift
-- L2: Control
-- L3: Alt
KeyModifierMap = {}
do
-- That moment when trying to be more concise goes terribly wrong
local keys = {{"Shift", "S", {0.4, 1, 0.4}}, {"Control", "C", {0.4, 0.4, 1}}, {"Alt", "A", {1, 0.4, 0.4}}}
local states = {true, false}
for _, l1State in ipairs(states) do
local l1 = {}
KeyModifierMap[l1State] = l1
for _, l2State in ipairs(states) do
local l2 = {}
l1[l2State] = l2
for _, l3State in ipairs(states) do
local keyStr = ""
local keyStrColored = ""
local keyAbbStr = ""
local keyAbbStrColored = ""
for i = 1, 3 do
if (i == 1 and l1State) or (i == 2 and l2State) or (i == 3 and l3State) then
local key = keys[i]
if keyStr ~= "" then
keyStr = keyStr.."+"
keyStrColored = keyStrColored.."+"
keyAbbStr = keyAbbStr.."+"
keyAbbStrColored = keyAbbStrColored.."+"
end
keyStr = keyStr..key[1]
keyStrColored = keyStrColored..Colorize(key[1], key[3])
keyAbbStr = keyAbbStr..key[2]
keyAbbStrColored = keyAbbStrColored..Colorize(key[2], key[3])
end
end
if keyStr == "" then
keyStr = "None"
keyStrColored = "None"
keyAbbStr = "None"
keyAbbStrColored = "None"
end
l2[l3State] = {keyStr, keyStrColored, keyAbbStr, keyAbbStrColored}
end
end
end
end
function GetKeyModifier()
return KeyModifierMap[IsShiftKeyDown() == 1][IsControlKeyDown() == 1][IsAltKeyDown() == 1][1]
end
function GetColoredKeyModifier()
return KeyModifierMap[IsShiftKeyDown() == 1][IsControlKeyDown() == 1][IsAltKeyDown() == 1][2]
end
function GetAbbreviatedKeyModifier()
return KeyModifierMap[IsShiftKeyDown() == 1][IsControlKeyDown() == 1][IsAltKeyDown() == 1][3]
end
function GetColoredAbbreviatedKeyModifier()
return KeyModifierMap[IsShiftKeyDown() == 1][IsControlKeyDown() == 1][IsAltKeyDown() == 1][4]
end
function GetKeyModifierTypeByID(id)
return KeyModifierMap[IsShiftKeyDown() == 1][IsControlKeyDown() == 1][IsAltKeyDown() == 1][id]
end
local buttons = {"LeftButton", "MiddleButton", "RightButton", "Button4", "Button5"}
function GetAllButtons()
return buttons
end
local upButtons = {}
for _, button in ipairs(buttons) do
table.insert(upButtons, button.."Up")
end
function GetUpButtons()
return upButtons
end
local downButtons = {}
for _, button in ipairs(buttons) do
table.insert(downButtons, button.."Down")
end
function GetDownButtons()
return downButtons
end
function GetCenterScreenPoint(componentWidth, componentHeight)
return "TOPLEFT", (GetScreenWidth() / 2) - (componentWidth / 2), -((GetScreenHeight() / 2) - (componentHeight / 2))
end
function GetPowerType(unit)
return PowerTypeMap[UnitPowerType(unit)]
end
function GetPowerColor(unit)
return PowerColors[GetPowerType(unit)]
end
-- Returns distance if UnitXP SP3 or SuperWoW is present;
-- 0 if unit is offline, or unit is enemy and SuperWoW is the distance provider;
-- 9999 if unit is not visible or UnitXP SP3 is not present.
-- Might try to do hacky stuff for people without mods later on.
function GetDistanceTo(unit)
return GetDistanceBetween("player", unit)
end
function GetDistanceBetween_SuperWow(unit1, unit2)
if not UnitIsConnected(unit1) or not UnitIsConnected(unit2) then
return 0
end
if not UnitIsVisible(unit1) or not UnitIsVisible(unit2) then
return 9999
end
local x1, z1, y1 = UnitPosition(unit1)
local x2, z2, y2 = UnitPosition(unit2)
if not x1 or not x2 then
return 0
end
local dx = x2 - x1
local dz = z2 - z1
local dy = y2 - y1
return math.sqrt(dx*dx + dz*dz + dy*dy)
end
function GetDistanceBetween_UnitXPSP3_Legacy(unit1, unit2)
if not UnitIsConnected(unit1) or not UnitIsConnected(unit2) then
return 0
end
if not UnitIsVisible(unit1) or not UnitIsVisible(unit2) then
return 9999
end
return math.max((UnitXP("distanceBetween", unit1, unit2) or (9999 + 3)) - 3, 0) -- UnitXP SP3 modded function
end
function GetDistanceBetween_UnitXPSP3(unit1, unit2)
if not UnitIsConnected(unit1) or not UnitIsConnected(unit2) then
return 0
end
if not UnitIsVisible(unit1) or not UnitIsVisible(unit2) then
return 9999
end
return math.max(UnitXP("distanceBetween", unit1, unit2) or 9999, 0) -- UnitXP SP3 modded function
end
function GetDistanceBetween_Vanilla(unit1, unit2)
if not UnitIsConnected(unit1) or not UnitIsConnected(unit2) then
return 0
end
if not UnitIsVisible(unit1) or not UnitIsVisible(unit2) then
return 9999
end
if unit1 == "player" then
if CheckInteractDistance(unit2, 3) then
return 9
end
if CheckInteractDistance(unit2, 4) then
return 27
end
end
return 28
end
if UnitXPSP3 then
if UnitXPSP3_Version > -1 then -- Newer versions have more accurate distances
GetDistanceBetween = GetDistanceBetween_UnitXPSP3
else -- Fall back to old distance calculation
GetDistanceBetween = GetDistanceBetween_UnitXPSP3_Legacy
end
elseif SuperWoW then
GetDistanceBetween = GetDistanceBetween_SuperWow
else -- sad
GetDistanceBetween = GetDistanceBetween_Vanilla
end
-- SuperWoW cannot provide precise distance for enemies
function CanClientGetPreciseDistance(alsoEnemies)
return UnitXPSP3 or (SuperWoW and not alsoEnemies)
end
-- Returns whether unit is in sight if UnitXP SP3 is present, otherwise always true.
IsInSight = function()
return true
end
do -- This is done to prevent crashes from checking sight too early
local sightEnableFrame = CreateFrame("Frame")
sightEnableFrame:RegisterEvent("ADDON_LOADED")
sightEnableFrame:SetScript("OnEvent", function()
if arg1 == "HealersMate" and UnitXPSP3 then
IsInSight = function(unit)
return UnitXP("inSight", "player", unit) -- UnitXP SP3 modded function
end
sightEnableFrame:SetScript("OnEvent", nil)
end
end)
end
function CanClientSightCheck()
return UnitXPSP3
end
function IsSuperWowPresent()
return SuperWoW
end
function IsUnitXPSP3Present()
return UnitXPSP3
end
-- Only detects Pepopo's Nampower
function IsNampowerPresent()
return Nampower
end
function IsTurtleWow()
return TurtleWow
end
AllUnitsSet = ToSet(AllUnits)
FocusUnitsSet = ToSet(FocusUnits)