+-- GiftTracker.lua
+local _;
+local GetTime = GetTime;
+local frame = CreateFrame("Cooldown", "OmaGiftCD", UIParent, "CooldownFrameTemplate");
+local line = CreateFrame("Frame", "OmaLine", UIParent);
+local playerGuid = nil;
+
+local function clog(ts, event, _, source, _, _, _, dest, _, _, _, spellid, ...)
+ if event == "SPELL_AURA_APPLIED" and spellid == 312406 and dest == playerGuid then
+ line:Show();
+ elseif event == "SPELL_AURA_REMOVED" and spellid == 312406 and dest == playerGuid then
+ line:Hide();
+ end
+end
+
+local function gift()
+ frame:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 500, -400);
+ frame:SetPoint("BOTTOMRIGHT", UIParent, "TOPLEFT", 580, -480);
+ frame.base = frame:CreateTexture(nil, "BACKGROUND");
+ frame.base:SetAllPoints();
+ frame.base:SetColorTexture(0, 0, 0, 0.5);
+ frame.stone = frame:CreateTexture(nil, "BORDER");
+ frame.stone:SetPoint("TOPLEFT", frame.base, "TOPLEFT", 1, -1);
+ frame.stone:SetPoint("BOTTOMRIGHT", frame.base, "BOTTOMRIGHT", -1, 1);
+ frame.stone:SetTexCoord(0.07, 0.93, 0.07, 0.93);
+ frame.stone:SetTexture(2000853); -- Gift Texture
+ frame:Hide();
+
+ playerGuid = UnitGUID("player");
+ frame:UnregisterAllEvents();
+ frame:SetScript("OnEvent", function()
+ return clog(CombatLogGetCurrentEventInfo());
+ end);
+ frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
+end
+
+frame:SetScript("OnEvent", gift);
+frame:RegisterEvent("PLAYER_LOGIN");
+
+local function lineConf()
+ line:SetPoint("CENTER", UIParent, "CENTER", 0, 100);
+ line:SetHeight(350);
+ line:SetWidth(5);
+ line.base = line:CreateTexture(nil, "BACKGROUND");
+ line.base:SetAllPoints();
+ line.base:SetColorTexture(1, 1, 1, 0.85);
+ line:Hide();
+ line:UnregisterAllEvents();
+ line:SetScript("OnEvent", function()
+ return clog(CombatLogGetCurrentEventInfo());
+ end);
+ line:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
+end
+
+line:SetScript("OnEvent", lineConf);
+line:RegisterEvent("PLAYER_LOGIN");