Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
faa156e527 | |||
cab0a68cc1 | |||
3227ed2d61 | |||
62ba56419d | |||
acbbe1637d | |||
0659493aad | |||
85cb445e8e | |||
c75700cb76 | |||
57be5140aa | |||
01550ebb67 | |||
d064e8b64d |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1 +1,2 @@
|
|||||||
.zip filter=lfs diff=lfs merge=lfs -text
|
.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
@@ -1,13 +1,52 @@
|
|||||||
local addonname, shared = ...
|
local addonname, shared = ...
|
||||||
---@cast addonname string
|
---@cast addonname string
|
||||||
|
|
||||||
---@class DechickenatorData
|
---@class shared
|
||||||
---@field blacklistedBuffs table<string, boolean>
|
---@field timer number?
|
||||||
|
shared = { timer = nil }
|
||||||
|
|
||||||
|
---@class DechickenatorData
|
||||||
|
---@field alerts table<string, Alert>
|
||||||
|
|
||||||
|
---@alias auraType
|
||||||
|
---| 'BUFF'
|
||||||
|
---| 'DEBUFF'
|
||||||
|
|
||||||
|
--/dechicken a:Greater Blessing of Kings;R;e:spit;m:cuntfucker %s;c:SAY
|
||||||
|
--/dechicken a:Greater Blessing of Kings;R;e:spit;m:cuntfucker
|
||||||
|
--/dechicken a:Greater Blessing of Kings;R;e:spit;m:cuntfucker
|
||||||
|
--/dechicken a:Greater Blessing of Kings;R;m:cuntfucker
|
||||||
|
--/dechicken a:Turkey Feathers;R;e:laugh
|
||||||
|
---@class Alert
|
||||||
|
---@field message string?
|
||||||
|
---@field channel string?
|
||||||
|
---@field channelData string?
|
||||||
|
---@field emote string?
|
||||||
|
---@field spellName string
|
||||||
|
---@field remove boolean?
|
||||||
|
|
||||||
|
--/run Dechickenator_Data = {alerts={}}
|
||||||
if not Dechickenator_Data then Dechickenator_Data = {} end
|
if not Dechickenator_Data then Dechickenator_Data = {} end
|
||||||
if not Dechickenator_Data.blacklistedBuffs then Dechickenator_Data.blacklistedBuffs = {} end
|
if not Dechickenator_Data.alerts then Dechickenator_Data.alerts = {} end
|
||||||
if not Dechickenator_Data.message then Dechickenator_Data.message = "Индивидуум %s хочет поделиться своим истинным обликом" end
|
|
||||||
local function init()
|
local function init()
|
||||||
|
local function RemoveBuff(buff)
|
||||||
|
if UnitAffectingCombat("player") then return end
|
||||||
|
CancelUnitBuff("player", buff)
|
||||||
|
end
|
||||||
|
local function RemoveBuffs()
|
||||||
|
if UnitAffectingCombat("player") then return end
|
||||||
|
for buff, enabled in pairs(Dechickenator_Data.alerts) do
|
||||||
|
if enabled then
|
||||||
|
RemoveBuff(buff)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not shared.timer then
|
||||||
|
shared.timer = C_Timer.NewTicker(1, function()
|
||||||
|
RemoveBuffs()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
local cleuFrame = CreateFrame("Frame")
|
local cleuFrame = CreateFrame("Frame")
|
||||||
cleuFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
cleuFrame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
||||||
cleuFrame:SetScript("OnEvent", function(self, event, ...)
|
cleuFrame:SetScript("OnEvent", function(self, event, ...)
|
||||||
@@ -16,12 +55,25 @@ local function init()
|
|||||||
local target = CLEUParser.GetDestName(...)
|
local target = CLEUParser.GetDestName(...)
|
||||||
if target ~= UnitName("player") then return end
|
if target ~= UnitName("player") then return end
|
||||||
local spellName = CLEUParser.GetSpellName(...)
|
local spellName = CLEUParser.GetSpellName(...)
|
||||||
if not Dechickenator_Data.blacklistedBuffs[spellName] then return end
|
if not Dechickenator_Data.alerts[spellName] then return end
|
||||||
local source = CLEUParser.GetSourceName(...)
|
local source = CLEUParser.GetSourceName(...)
|
||||||
local msg = string.format(Dechickenator_Data.message, tostring(source))
|
if Dechickenator_Data.alerts[spellName].message then
|
||||||
CancelUnitBuff("player", spellName)
|
local msg = Dechickenator_Data.alerts[spellName].message
|
||||||
SendChatMessage(msg, "EMOTE")
|
if string.find(msg, "%s") then
|
||||||
DoEmote("spit", source)
|
msg = string.format(msg, tostring(source))
|
||||||
|
end
|
||||||
|
local channel = "SAY"
|
||||||
|
if Dechickenator_Data.alerts[spellName].channel then
|
||||||
|
channel = Dechickenator_Data.alerts[spellName].channel
|
||||||
|
end
|
||||||
|
SendChatMessage(msg, channel)
|
||||||
|
end
|
||||||
|
if Dechickenator_Data.alerts[spellName].emote then
|
||||||
|
DoEmote(Dechickenator_Data.alerts[spellName].emote, source)
|
||||||
|
end
|
||||||
|
if Dechickenator_Data.alerts[spellName].remove then
|
||||||
|
RemoveBuff(spellName)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -36,14 +88,52 @@ loadedFrame:SetScript("OnEvent", function(self, event, addonName)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
SlashCmdList["DECHICKENATOR_TOGGLE_BLACKLISTED_BUFF"] = function(input)
|
---@param table table
|
||||||
print("Toggling blacklisted buff: " .. tostring(input))
|
---@param depth number?
|
||||||
if Dechickenator_Data.blacklistedBuffs[input] then
|
function DumpTable(table, depth)
|
||||||
Dechickenator_Data.blacklistedBuffs[input] = nil
|
if depth == nil then
|
||||||
else
|
depth = 0
|
||||||
Dechickenator_Data.blacklistedBuffs[input] = true
|
end
|
||||||
|
if (depth > 200) then
|
||||||
|
print("Error: Depth > 200 in dumpTable()")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
for k, v in pairs(table) do
|
||||||
|
if (type(v) == "table") then
|
||||||
|
print(string.rep(" ", depth) .. k .. ":")
|
||||||
|
DumpTable(v, depth + 1)
|
||||||
|
else
|
||||||
|
print(string.rep(" ", depth) .. k .. ": ", v)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
SlashCmdList["DECHICKENATOR_TOGGLE_BLACKLISTED_BUFF"] = function(input)
|
||||||
|
local fields = { strsplit(";", input) }
|
||||||
|
---@type Alert
|
||||||
|
local aura = { spellName = "" }
|
||||||
|
|
||||||
|
for _, field in ipairs(fields) do
|
||||||
|
local data = { strsplit(":", field) }
|
||||||
|
local key = strtrim(data[1])
|
||||||
|
key = string.lower(key)
|
||||||
|
if key == "a" then
|
||||||
|
aura.spellName = strtrim(data[2])
|
||||||
|
elseif key == "e" then
|
||||||
|
aura.emote = strtrim(data[2])
|
||||||
|
elseif key == "m" then
|
||||||
|
aura.message = strtrim(data[2])
|
||||||
|
elseif key == "c" then
|
||||||
|
aura.channel = strtrim(data[2])
|
||||||
|
elseif key == "r" then
|
||||||
|
aura.remove = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
DumpTable(aura)
|
||||||
|
if aura.spellName ~= "" then
|
||||||
|
Dechickenator_Data.alerts[aura.spellName] = aura
|
||||||
end
|
end
|
||||||
print(Dechickenator_Data.blacklistedBuffs[input])
|
|
||||||
end
|
end
|
||||||
SLASH_DECHICKENATOR_TOGGLE_BLACKLISTED_BUFF1 = "/dechicken"
|
SLASH_DECHICKENATOR_TOGGLE_BLACKLISTED_BUFF1 = "/dechicken"
|
||||||
|
|
||||||
@@ -52,4 +142,4 @@ SlashCmdList["DECHICKENATOR_SET_MESSAGE"] = function(input)
|
|||||||
Dechickenator_Data.message = input
|
Dechickenator_Data.message = input
|
||||||
print(Dechickenator_Data.message)
|
print(Dechickenator_Data.message)
|
||||||
end
|
end
|
||||||
SLASH_DECHICKENATOR_SET_MESSAGE1 = "/dechicken_message"
|
SLASH_DECHICKENATOR_SET_MESSAGE1 = "/dechicken_message"
|
||||||
|
Binary file not shown.
89
README.md
Normal file
89
README.md
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# Dechickenator
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
Dechickenator is a World of Warcraft addon that provides flexible buff and aura management with custom alerts and actions.
|
||||||
|
|
||||||
|
## Versions
|
||||||
|
- **v1 (Master)**: Simple buff removal with predefined actions
|
||||||
|
- **v2.0**: More complex alert system with customizable actions
|
||||||
|
|
||||||
|
## Features
|
||||||
|
- Automatically remove unwanted buffs
|
||||||
|
- Create custom alerts for specific spell auras
|
||||||
|
- Send personalized chat messages when buffs are applied
|
||||||
|
- Perform custom emotes triggered by specific buffs
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
1. Download the [addon](https://git.site.quack-lab.dev/dave/wow_dechickenator/raw/branch/2.0/Dechickenator.zip)
|
||||||
|
2. Extract the addon to your World of Warcraft `Interface/AddOns` directory
|
||||||
|
3. Ensure the addon is enabled in the character selection screen
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Use the `/dechicken` slash command to configure alerts with the following syntax:
|
||||||
|
|
||||||
|
### Command Structure
|
||||||
|
`/dechicken a:SpellName;[options]`
|
||||||
|
|
||||||
|
### Options
|
||||||
|
- `a:` - Spell/Aura name (required)
|
||||||
|
- `e:` - Emote to perform
|
||||||
|
- `m:` - Custom message to send (supports `%s` for source name)
|
||||||
|
- `c:` - Chat channel (default: SAY)
|
||||||
|
- `R` - Automatically remove the buff
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
```
|
||||||
|
# Remove "Greater Blessing of Kings" and send a message
|
||||||
|
/dechicken a:Greater Blessing of Kings;R;m:No buffs please!
|
||||||
|
|
||||||
|
# Perform a laugh emote when "Turkey Feathers" is applied
|
||||||
|
/dechicken a:Turkey Feathers;e:laugh
|
||||||
|
|
||||||
|
# Send a custom message in YELL channel
|
||||||
|
/dechicken a:Some Buff;m:Hey %s, nice buff!;c:YELL
|
||||||
|
```
|
||||||
|
|
||||||
|
# Dechickenator; Ruski
|
||||||
|
|
||||||
|
## Обзор
|
||||||
|
Dechickenator - это аддон для World of Warcraft, обеспечивающий гибкое управление баффами и аурами с настраиваемыми оповещениями и действиями.
|
||||||
|
|
||||||
|
## Версии
|
||||||
|
- **v1 (Master)**: Простое удаление баффов с предустановленными действиями
|
||||||
|
- **v2.0**: Более сложная система оповещений с настраиваемыми действиями
|
||||||
|
|
||||||
|
## Возможности
|
||||||
|
- Автоматическое удаление нежелательных баффов
|
||||||
|
- Создание пользовательских оповещений для определённых аур заклинаний
|
||||||
|
- Отправка персонализированных сообщений в чат при получении баффов
|
||||||
|
- Выполнение пользовательских эмоций при срабатывании определённых баффов
|
||||||
|
|
||||||
|
## Установка
|
||||||
|
1. Скачайте [аддон](https://git.site.quack-lab.dev/dave/wow_dechickenator/raw/branch/2.0/Dechickenator.zip)
|
||||||
|
2. Распакуйте аддон в директорию World of Warcraft `Interface/AddOns`
|
||||||
|
3. Убедитесь, что аддон включен на экране выбора персонажа
|
||||||
|
|
||||||
|
## Использование
|
||||||
|
Используйте команду `/dechicken` для настройки оповещений со следующим синтаксисом:
|
||||||
|
|
||||||
|
### Структура команды
|
||||||
|
`/dechicken a:НазваниеЗаклинания;[опции]`
|
||||||
|
|
||||||
|
### Опции
|
||||||
|
- `a:` - Название заклинания/ауры (обязательно)
|
||||||
|
- `e:` - Эмоция для выполнения
|
||||||
|
- `m:` - Пользовательское сообщение (`%s` для имени источника)
|
||||||
|
- `c:` - Канал чата (по умолчанию: SAY)
|
||||||
|
- `R` - Автоматически удалять бафф
|
||||||
|
|
||||||
|
### Примеры
|
||||||
|
```
|
||||||
|
# Удалить "Великое благословение королей" и отправить сообщение
|
||||||
|
/dechicken a:Великое благословение королей;R;m:Не нужны баффы!
|
||||||
|
|
||||||
|
# Выполнить эмоцию смеха при получении "Индюшачьих перьев"
|
||||||
|
/dechicken a:Индюшачьи перья;e:laugh
|
||||||
|
|
||||||
|
# Отправить пользовательское сообщение в канал YELL
|
||||||
|
/dechicken a:Какой-то бафф;m:Эй %s, классный бафф!;c:YELL
|
||||||
|
```
|
Reference in New Issue
Block a user