PHP код:
local Core = CreateFrame("MessageFrame", nil, UIParent);
Core:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
Core:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end);
Core:SetPoint("CENTER", UIParent, 0, 0); -- Расположение фрейма относительно центра;
Core:SetSize(512, 60);
Core:SetTimeVisible(2); -- Длительность отображения текста (сек.);
Core:SetFadeDuration(0.5);
Core:SetFading(true);
Core:SetIndentedWordWrap(true);
Core:SetInsertMode("TOP");
Core:SetFrameStrata("DIALOG");
Core:SetFrameLevel(1);
Core:SetToplevel(true);
Core:SetFontObject("ErrorFont"); -- Шрифт;
function Core:IsReflected(destGUID, missType)
if missType ~= "REFLECT" then return false; end;
if destGUID ~= UnitGUID("player") then return false; end;
return true;
end;
function Core:COMBAT_LOG_EVENT_UNFILTERED(...)
local _, eventType, _, sourceName, _, destGUID, _, _, _, spellName = select(1, ...);
if eventType == "SPELL_MISSED" then
local missType = select(12, ...);
if self:IsReflected(destGUID, missType) then
self:AddMessage("Reflected [|cff20B2AA" ..spellName.. "|r] --> ("..sourceName..")");
end;
end;
end;