2016-05-06 15:27:33 +02:00
|
|
|
|
|
|
|
--"Globals"
|
2016-05-06 15:45:39 +02:00
|
|
|
local aceDB = LibStub("AceDB-3.0");
|
|
|
|
local aceCDialog = LibStub("AceConfigDialog-3.0");
|
|
|
|
local aceConfig = LibStub("AceConfig-3.0");
|
|
|
|
local libSharedMedia = LibStub("LibSharedMedia-3.0");
|
|
|
|
local libDRData = LibStub('DRData-1.0');
|
2016-05-06 15:27:33 +02:00
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt.CombatlogFixTimerData = {
|
2016-05-10 11:04:53 +02:00
|
|
|
["lasttick"] = 0,
|
|
|
|
["timesinceclear"] = 0
|
|
|
|
}
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt.MovableFrames = nil
|
2016-05-06 15:29:04 +02:00
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt.targets = {
|
2016-05-06 15:27:33 +02:00
|
|
|
["target"] = nil,
|
2016-05-06 15:48:19 +02:00
|
|
|
["focus"] = nil,
|
|
|
|
["self"] = nil
|
2016-05-06 15:27:33 +02:00
|
|
|
}
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt.cds = {}
|
|
|
|
Rekt.drs = {}
|
2016-05-06 15:27:33 +02:00
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt.frames = {
|
2016-05-06 15:27:33 +02:00
|
|
|
["target"] = {},
|
2016-05-06 15:45:39 +02:00
|
|
|
["focus"] = {},
|
|
|
|
["targetdr"] = {},
|
|
|
|
["focusdr"] = {},
|
2016-05-10 11:18:26 +02:00
|
|
|
["selfdr"] = {},
|
|
|
|
["interruptbar"] = {}
|
2016-05-06 15:27:33 +02:00
|
|
|
}
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt.defaults = {
|
2016-05-06 15:27:33 +02:00
|
|
|
profile = {
|
|
|
|
enabled = true,
|
|
|
|
locked = true,
|
2016-05-06 15:29:04 +02:00
|
|
|
debugLevel = 0,
|
|
|
|
spellCastDebug = false,
|
|
|
|
spellAuraDebug = false,
|
|
|
|
allCDebug = false,
|
2016-05-06 15:30:18 +02:00
|
|
|
selfCDRegister = false,
|
2016-05-10 11:18:26 +02:00
|
|
|
selfIBCDRegister = false,
|
2016-05-10 11:10:31 +02:00
|
|
|
specdetection = true,
|
2016-05-06 16:08:08 +02:00
|
|
|
petcdguessing = true,
|
2016-05-06 15:27:33 +02:00
|
|
|
target = {
|
|
|
|
enabled = true,
|
2016-05-06 15:29:04 +02:00
|
|
|
size = 27,
|
|
|
|
xPos = 350,
|
|
|
|
yPos = 350,
|
2016-05-06 16:15:51 +02:00
|
|
|
growOrder = tostring(2),
|
|
|
|
sortOrder = tostring(5),
|
2016-05-06 16:05:24 +02:00
|
|
|
colorframeenabled = true,
|
|
|
|
colorframesize = 4
|
2016-05-06 15:27:33 +02:00
|
|
|
},
|
|
|
|
focus = {
|
|
|
|
enabled = true,
|
2016-05-06 15:29:04 +02:00
|
|
|
size = 27,
|
|
|
|
xPos = 380,
|
|
|
|
yPos = 380,
|
2016-05-06 16:15:51 +02:00
|
|
|
growOrder = tostring(2),
|
|
|
|
sortOrder = tostring(5),
|
2016-05-06 16:05:24 +02:00
|
|
|
colorframeenabled = true,
|
|
|
|
colorframesize = 4
|
2016-05-06 15:45:39 +02:00
|
|
|
},
|
2016-05-10 11:18:26 +02:00
|
|
|
interruptbar = {
|
|
|
|
enabled = true,
|
|
|
|
size = 27,
|
|
|
|
xPos = 350,
|
|
|
|
yPos = 350,
|
|
|
|
growOrder = tostring(2),
|
|
|
|
sortOrder = tostring(5),
|
|
|
|
colorframeenabled = true,
|
|
|
|
colorframesize = 4
|
|
|
|
},
|
2016-05-06 15:45:39 +02:00
|
|
|
targetdr = {
|
|
|
|
enabled = true,
|
|
|
|
size = 27,
|
|
|
|
xPos = 380,
|
|
|
|
yPos = 380,
|
2016-05-06 16:15:51 +02:00
|
|
|
growOrder = tostring(2),
|
|
|
|
sortOrder = tostring(5),
|
2016-05-06 15:49:39 +02:00
|
|
|
drnumsize = 14,
|
2016-05-06 16:15:51 +02:00
|
|
|
drnumposition = tostring(1)
|
2016-05-06 15:45:39 +02:00
|
|
|
},
|
|
|
|
focusdr = {
|
|
|
|
enabled = true,
|
|
|
|
size = 27,
|
|
|
|
xPos = 380,
|
|
|
|
yPos = 380,
|
2016-05-06 16:15:51 +02:00
|
|
|
growOrder = tostring(2),
|
|
|
|
sortOrder = tostring(5),
|
2016-05-06 15:49:39 +02:00
|
|
|
drnumsize = 14,
|
2016-05-06 16:15:51 +02:00
|
|
|
drnumposition = tostring(1)
|
2016-05-06 15:45:39 +02:00
|
|
|
},
|
|
|
|
selfdr = {
|
|
|
|
enabled = true,
|
|
|
|
size = 27,
|
|
|
|
xPos = 380,
|
|
|
|
yPos = 380,
|
2016-05-06 16:15:51 +02:00
|
|
|
growOrder = tostring(2),
|
|
|
|
sortOrder = tostring(5),
|
2016-05-06 15:49:39 +02:00
|
|
|
drnumsize = 14,
|
2016-05-06 16:15:51 +02:00
|
|
|
drnumposition = tostring(1)
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
color = {
|
|
|
|
gapcloser = {
|
|
|
|
a = 1,
|
|
|
|
b = 0,
|
|
|
|
g = 0.8117647058823529,
|
|
|
|
r = 1,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
anticc = {
|
|
|
|
a = 1,
|
|
|
|
b = 0.796078431372549,
|
|
|
|
g = 1,
|
|
|
|
r = 0,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
disarm = {
|
|
|
|
a = 1,
|
|
|
|
b = 0.9647058823529412,
|
|
|
|
g = 1,
|
|
|
|
r = 0,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
defensive = {
|
|
|
|
a = 1,
|
|
|
|
b = 0.08627450980392157,
|
|
|
|
g = 1,
|
|
|
|
r = 0.2,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
nuke = {
|
|
|
|
a = 1,
|
|
|
|
b = 0,
|
|
|
|
g = 0,
|
|
|
|
r = 1,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
shield = {
|
|
|
|
a = 1,
|
|
|
|
b = 0.3333333333333333,
|
|
|
|
g = 1,
|
|
|
|
r = 0.8901960784313725,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
potion = {
|
|
|
|
a = 1,
|
|
|
|
b = 0.6313725490196078,
|
|
|
|
g = 0.7372549019607844,
|
|
|
|
r = 1,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
cdreset = {
|
|
|
|
a = 1,
|
|
|
|
b = 1,
|
|
|
|
g = 0,
|
|
|
|
r = 0.6274509803921569,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
silence = {
|
|
|
|
a = 1,
|
|
|
|
b = 1,
|
|
|
|
g = 0.03529411764705882,
|
|
|
|
r = 0.1882352941176471,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
stun = {
|
|
|
|
a = 1,
|
|
|
|
b = 1,
|
|
|
|
g = 0.07450980392156863,
|
|
|
|
r = 0.9137254901960784,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
uncategorized = {
|
|
|
|
a = 1,
|
|
|
|
b = 1,
|
|
|
|
g = 0.9058823529411765,
|
|
|
|
r = 0.9607843137254902,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
2016-05-06 16:08:08 +02:00
|
|
|
cc = {
|
|
|
|
a = 1,
|
|
|
|
b = 0.3686274509803922,
|
|
|
|
g = 0.3568627450980392,
|
|
|
|
r = 0.3764705882352941,
|
2016-05-06 16:05:24 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
cdtypesortorder = {
|
|
|
|
enabled = true,
|
|
|
|
silence = 1,
|
|
|
|
gapcloser = 2,
|
2016-05-06 16:13:29 +02:00
|
|
|
defensive = 6,
|
|
|
|
potion = 12,
|
|
|
|
nuke = 7,
|
|
|
|
anticc = 5,
|
|
|
|
cc = 4,
|
|
|
|
stun = 3,
|
2016-05-06 16:05:24 +02:00
|
|
|
disarm = 9,
|
|
|
|
cdreset = 10,
|
2016-05-06 16:13:29 +02:00
|
|
|
shield = 5,
|
|
|
|
uncategorized = 13
|
2016-05-06 15:27:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:Reset()
|
|
|
|
Rekt.cds = {}
|
|
|
|
Rekt.drs = {}
|
|
|
|
Rekt.target = {unitGUID = -1, timers = {}}
|
|
|
|
Rekt.focus = {unitGUID = -1, timers = {}}
|
|
|
|
Rekt:HideSelfDRFrames();
|
2016-05-06 15:27:33 +02:00
|
|
|
end
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:OnInitialize()
|
|
|
|
self.db = aceDB:New("RektDB", self.defaults);
|
2016-05-06 15:29:04 +02:00
|
|
|
self.db.RegisterCallback(self, "OnProfileChanged", function() self:ApplySettings() end);
|
|
|
|
self.db.RegisterCallback(self, "OnProfileCopied", function() self:ApplySettings() end);
|
|
|
|
self.db.RegisterCallback(self, "OnProfileReset", function() self:ApplySettings() end);
|
2016-05-10 11:07:23 +02:00
|
|
|
aceConfig:RegisterOptionsTable("Rekt", self:GetRektOptions());
|
|
|
|
aceCDialog:AddToBlizOptions("Rekt");
|
|
|
|
self:RegisterChatCommand("Rekt", "ChatCommand");
|
2016-05-10 11:04:53 +02:00
|
|
|
|
2016-05-06 15:27:33 +02:00
|
|
|
end
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:OnEnable()
|
2016-05-06 15:27:33 +02:00
|
|
|
self:Reset()
|
2016-05-10 11:04:53 +02:00
|
|
|
self:RegisterEvent("PLAYER_ENTERING_WORLD");
|
|
|
|
self:RegisterEvent("ZONE_CHANGED_NEW_AREA");
|
|
|
|
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
|
|
|
|
self:RegisterEvent("PLAYER_TARGET_CHANGED");
|
|
|
|
self:RegisterEvent("PLAYER_FOCUS_CHANGED");
|
2016-05-06 15:27:33 +02:00
|
|
|
self:CreateFrames("target");
|
|
|
|
self:CreateFrames("focus");
|
2016-05-06 15:45:39 +02:00
|
|
|
self:CreateDRFrames("targetdr");
|
|
|
|
self:CreateDRFrames("focusdr");
|
|
|
|
self:CreateDRFrames("selfdr");
|
2016-05-10 11:18:26 +02:00
|
|
|
self:CreateInterruptBarFrames();
|
2016-05-06 15:27:33 +02:00
|
|
|
self:ApplySettings();
|
2016-05-06 15:48:19 +02:00
|
|
|
self.targets["self"] = UnitGUID("player");
|
2016-05-10 11:04:53 +02:00
|
|
|
|
|
|
|
--cause, and basic fix from:
|
|
|
|
--from http://www.arenajunkies.com/topic/125096-combat-log-error-screwing-up-your-addons-supposed-fix/
|
|
|
|
local f = CreateFrame("Frame", nil, UIParent);
|
|
|
|
f:SetScript("OnUpdate", function() self:CombatLogClearFix() end);
|
2016-05-06 15:27:33 +02:00
|
|
|
end
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:CombatLogClearFix()
|
2016-05-10 11:04:53 +02:00
|
|
|
--delta is in seconds
|
2016-05-10 11:07:23 +02:00
|
|
|
local delta = GetTime() - Rekt.CombatlogFixTimerData["lasttick"];
|
2016-05-10 11:04:53 +02:00
|
|
|
|
|
|
|
--this will happen on the first run, this is here, becouse on the first test,
|
|
|
|
--the first clear on load just bugged the addon, until the second clear
|
|
|
|
if delta > 30 then
|
|
|
|
return;
|
|
|
|
end
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
local tslc = Rekt.CombatlogFixTimerData["timesinceclear"] + delta;
|
2016-05-10 11:04:53 +02:00
|
|
|
|
|
|
|
--30 seconds should be enough
|
|
|
|
if tslc >= 30 then
|
|
|
|
CombatLogClearEntries();
|
|
|
|
tslc = 0;
|
|
|
|
end
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt.CombatlogFixTimerData["timesinceclear"] = tslc;
|
|
|
|
Rekt.CombatlogFixTimerData["lasttick"] = GetTime();
|
2016-05-10 11:04:53 +02:00
|
|
|
end
|
2016-05-06 15:27:33 +02:00
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:OnDisable()
|
2016-05-10 11:04:53 +02:00
|
|
|
self:UnregisterEvent("PLAYER_ENTERING_WORLD");
|
|
|
|
self:UnregisterEvent("ZONE_CHANGED_NEW_AREA");
|
|
|
|
self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
|
|
|
|
self:UnregisterEvent("PLAYER_TARGET_CHANGED");
|
|
|
|
self:UnregisterEvent("PLAYER_FOCUS_CHANGED");
|
2016-05-06 15:37:12 +02:00
|
|
|
self.Reset();
|
2016-05-06 15:27:33 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:ChatCommand(input)
|
2016-05-06 15:41:20 +02:00
|
|
|
if not input or input:trim() == "" then
|
2016-05-10 11:07:23 +02:00
|
|
|
aceCDialog:Open("Rekt");
|
2016-05-06 15:41:20 +02:00
|
|
|
else
|
2016-05-10 11:07:23 +02:00
|
|
|
LibStub("AceConfigCmd-3.0").HandleCommand(Rekt, "Rekt", "Rekt", input);
|
2016-05-06 15:41:20 +02:00
|
|
|
end
|
2016-05-06 15:27:33 +02:00
|
|
|
end
|
|
|
|
|
2016-05-06 15:48:19 +02:00
|
|
|
local COMBATLOG_OBJECT_TYPE_PLAYER = COMBATLOG_OBJECT_TYPE_PLAYER
|
|
|
|
local COMBATLOG_OBJECT_REACTION_HOSTILE = COMBATLOG_OBJECT_REACTION_HOSTILE
|
|
|
|
local COMBATLOG_OBJECT_CONTROL_PLAYER = COMBATLOG_OBJECT_CONTROL_PLAYER
|
|
|
|
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, eventType, srcGUID, srcName, srcFlags,
|
2016-05-06 15:27:33 +02:00
|
|
|
dstGUID, dstName, dstFlags, spellID, spellName, spellSchool,
|
|
|
|
detail1, detail2, detail3)
|
2016-05-10 11:07:23 +02:00
|
|
|
local db = Rekt.db.profile;
|
2016-05-06 15:37:12 +02:00
|
|
|
|
|
|
|
if not db["enabled"] then return end;
|
2016-05-06 15:29:04 +02:00
|
|
|
|
|
|
|
--debugAll
|
|
|
|
if db["allCDebug"] then
|
2016-05-06 15:27:33 +02:00
|
|
|
self:Print("eventType: " .. eventType .. " id: " .. spellID .. " spellName: " .. spellName);
|
|
|
|
end
|
|
|
|
|
2016-05-06 15:29:04 +02:00
|
|
|
--debugAura
|
|
|
|
if db["spellAuraDebug"] then
|
|
|
|
if eventType == "SPELL_AURA_APPLIED" or eventType == "SPELL_AURA_REMOVED" or eventType == "SPELL_AURA_APPLIED_DOSE" or
|
|
|
|
eventType == "SPELL_AURA_REMOVED_DOSE" or eventType == "SPELL_AURA_REFRESH" or eventType == "SPELL_AURA_BROKEN" or
|
|
|
|
eventType == "SPELL_AURA_BROKEN_SPELL" then
|
|
|
|
self:Print("eventType: " .. eventType .. " id: " .. spellID .. " spellName: " .. spellName);
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-05-06 15:27:33 +02:00
|
|
|
if eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_AURA_APPLIED" then
|
2016-05-06 15:29:04 +02:00
|
|
|
--debug spell
|
|
|
|
if db["spellCastDebug"] and eventType == "SPELL_CAST_SUCCESS" then
|
|
|
|
self:Print("id: " .. spellID .. " spellName: " .. spellName);
|
|
|
|
end
|
2016-05-06 15:27:33 +02:00
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
if Rekt.spells[spellID] then
|
2016-05-10 11:18:26 +02:00
|
|
|
Rekt:AddCd(srcGUID, spellID, srcFlags);
|
2016-05-06 15:27:33 +02:00
|
|
|
end
|
2016-05-06 15:48:19 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
--DR stuff
|
|
|
|
if( eventType == "SPELL_AURA_APPLIED" ) then
|
|
|
|
if(detail1 == "DEBUFF" and libDRData:GetSpellCategory(spellID)) then
|
|
|
|
local isPlayer = (bit.band(dstFlags, COMBATLOG_OBJECT_TYPE_PLAYER) == COMBATLOG_OBJECT_TYPE_PLAYER or bit.band(dstFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) == COMBATLOG_OBJECT_CONTROL_PLAYER)
|
|
|
|
|
|
|
|
if (not isPlayer and not libDRData:IsPVE(drCat)) then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
local drCat = libDRData:GetSpellCategory(spellID);
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt:DRDebuffGained(spellID, dstGUID, isPlayer);
|
2016-05-06 15:48:19 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Enemy had a debuff refreshed before it faded, so fade + gain it quickly
|
|
|
|
elseif(eventType == "SPELL_AURA_REFRESH" ) then
|
|
|
|
if(detail1 == "DEBUFF" and libDRData:GetSpellCategory(spellID)) then
|
|
|
|
local isPlayer = (bit.band(dstFlags, COMBATLOG_OBJECT_TYPE_PLAYER) == COMBATLOG_OBJECT_TYPE_PLAYER or bit.band(dstFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) == COMBATLOG_OBJECT_CONTROL_PLAYER)
|
|
|
|
|
|
|
|
if (not isPlayer and not libDRData:IsPVE(drCat)) then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt:DRDebuffFaded(spellID, dstGUID, isPlayer);
|
|
|
|
Rekt:DRDebuffGained(spellID, dstGUID, isPlayer);
|
2016-05-06 15:48:19 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Buff or debuff faded from an enemy
|
|
|
|
elseif(eventType == "SPELL_AURA_REMOVED" ) then
|
|
|
|
if(detail1 == "DEBUFF" and libDRData:GetSpellCategory(spellID)) then
|
|
|
|
local isPlayer = (bit.band(dstFlags, COMBATLOG_OBJECT_TYPE_PLAYER) == COMBATLOG_OBJECT_TYPE_PLAYER or bit.band(dstFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) == COMBATLOG_OBJECT_CONTROL_PLAYER)
|
|
|
|
|
|
|
|
if (not isPlayer and not libDRData:IsPVE(drCat)) then
|
|
|
|
return
|
|
|
|
end
|
2016-05-06 16:12:06 +02:00
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt:DRDebuffFaded(spellID, dstGUID, isPlayer);
|
2016-05-06 15:48:19 +02:00
|
|
|
end
|
|
|
|
end
|
2016-05-06 15:27:33 +02:00
|
|
|
end
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:PLAYER_TARGET_CHANGED()
|
2016-05-06 15:27:33 +02:00
|
|
|
local unitGUID = UnitGUID("target");
|
|
|
|
self.targets["target"] = unitGUID;
|
|
|
|
self:ReassignCds("target");
|
2016-05-06 15:48:19 +02:00
|
|
|
self:ReassignDRs("targetdr");
|
2016-05-06 15:27:33 +02:00
|
|
|
end
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:PLAYER_FOCUS_CHANGED()
|
2016-05-06 15:27:33 +02:00
|
|
|
local unitGUID = UnitGUID("focus");
|
|
|
|
self.targets["focus"] = unitGUID;
|
|
|
|
self:ReassignCds("focus");
|
2016-05-06 15:48:19 +02:00
|
|
|
self:ReassignDRs("focusdr");
|
2016-05-06 15:27:33 +02:00
|
|
|
end
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:PLAYER_ENTERING_WORLD()
|
2016-05-06 15:44:01 +02:00
|
|
|
--DB cleanup
|
|
|
|
local t = GetTime();
|
2016-05-10 11:07:23 +02:00
|
|
|
for k, v in pairs(Rekt.cds) do
|
2016-05-06 15:44:01 +02:00
|
|
|
for i, j in pairs(v) do
|
2016-05-06 16:04:09 +02:00
|
|
|
if not (i == "spec") then
|
|
|
|
if j[2] < t then
|
2016-05-10 11:07:23 +02:00
|
|
|
--self:Print(Rekt.cds[k][i][4]);
|
|
|
|
Rekt.cds[k][i] = nil;
|
2016-05-06 16:04:09 +02:00
|
|
|
end
|
2016-05-06 15:44:01 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt.drs = {}
|
2016-05-06 15:29:04 +02:00
|
|
|
end
|
2016-05-06 15:27:33 +02:00
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:ZONE_CHANGED_NEW_AREA()
|
2016-05-06 15:29:04 +02:00
|
|
|
local type = select(2, IsInInstance())
|
|
|
|
-- If we are entering an arena
|
|
|
|
if (type == "arena") then
|
|
|
|
self:Reset();
|
|
|
|
end
|
2016-05-06 15:27:33 +02:00
|
|
|
end
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
function Rekt:ApplySettings()
|
|
|
|
local db = Rekt.db.profile;
|
2016-05-10 11:18:26 +02:00
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt:MoveTimersStop("target");
|
|
|
|
Rekt:MoveTimersStop("focus");
|
|
|
|
Rekt:ReassignCds("target");
|
|
|
|
Rekt:ReassignCds("focus");
|
2016-05-10 11:18:26 +02:00
|
|
|
|
|
|
|
Rekt:MoveTimersStop("interruptbar");
|
|
|
|
Rekt:ReassignIBCds();
|
|
|
|
|
2016-05-10 11:07:23 +02:00
|
|
|
Rekt:MoveDRTimersStop("targetdr");
|
|
|
|
Rekt:MoveDRTimersStop("focusdr");
|
|
|
|
Rekt:MoveDRTimersStop("selfdr");
|
|
|
|
Rekt:ReassignDRs("targetdr");
|
|
|
|
Rekt:ReassignDRs("focusdr");
|
|
|
|
Rekt:ReassignDRs("selfdr");
|
2016-05-10 11:18:26 +02:00
|
|
|
|
2016-05-06 15:29:04 +02:00
|
|
|
if not db["locked"] then self:ShowMovableFrames() end;
|
2016-05-06 15:27:33 +02:00
|
|
|
end
|