local addonname, shared = ... ---@cast addonname string ---@class DechickenatorData ---@field blacklistedBuffs table if not Dechickenator_Data then Dechickenator_Data = {} end if not Dechickenator_Data.blacklistedBuffs then Dechickenator_Data.blacklistedBuffs = {} end local function init() local cleuFrame = CreateFrame("Frame") cleuFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") cleuFrame:SetScript("OnEvent", function(self, event, ...) local subevent = CLEUParser.GetSubevent(...) if subevent == "SPELL_AURA_APPLIED" or subevent == "SPELL_AURA_REFRESH" then local target = CLEUParser.GetDestName(...) if target ~= UnitName("player") then return end local spellName = CLEUParser.GetSpellName(...) print(spellName) if not Dechickenator_Data.blacklistedBuffs[spellName] then return end local source = CLEUParser.GetSourceName(...) print(source) local msg = string.format("Индивидуум %s хочет поделиться своим истинным обликом", tostring(source)) CancelUnitBuff("player", spellName) SendChatMessage(msg, "EMOTE") DoEmote("spit", source) end end) print("Dechickenator loaded!") end local loadedFrame = CreateFrame("Frame") loadedFrame:RegisterEvent("ADDON_LOADED") loadedFrame:SetScript("OnEvent", function(self, event, addonName) if addonName == addonname then init() end end) SlashCmdList["DECHICKENATOR_TOGGLE_BLACKLISTED_BUFF"] = function(input) print("Toggling blacklisted buff: " .. tostring(input)) if Dechickenator_Data.blacklistedBuffs[input] then Dechickenator_Data.blacklistedBuffs[input] = nil else Dechickenator_Data.blacklistedBuffs[input] = true end print(Dechickenator_Data.blacklistedBuffs[input]) end SLASH_DECHICKENATOR_TOGGLE_BLACKLISTED_BUFF1 = "/dechicken"