testmode random Auras + Interrupts only with enabled Auras + Interrupts

This commit is contained in:
Sumsebrum 2021-07-29 15:13:19 +02:00
parent 0d5b5644a9
commit 74753e327c
3 changed files with 62 additions and 27 deletions

View File

@ -167,7 +167,7 @@ function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
end
end
local exceptionNames = { -- TODO MOVE ME TO CLASSBUFFS LIB
Gladdy.exceptionNames = { -- TODO MOVE ME TO CLASSBUFFS LIB
[31117] = GetSpellInfo(30405) .. " Silence", -- Unstable Affliction Silence
[43523] = GetSpellInfo(30405) .. " Silence",
[24131] = select(1, GetSpellInfo(19386)) .. " Dot", -- Wyvern Sting Dot
@ -207,8 +207,8 @@ function EventListener:UNIT_AURA(unit)
Gladdy:DetectSpec(unit, Gladdy.specBuffs[spellName])
end
end
if exceptionNames[spellID] then
spellName = exceptionNames[spellID]
if Gladdy.exceptionNames[spellID] then
spellName = Gladdy.exceptionNames[spellID]
end
Gladdy:SendMessage("AURA_GAIN", unit, auraType, spellID, spellName, texture, duration, expirationTime, count, debuffType, i)
Gladdy:Call("Announcements", "CheckDrink", unit, spellName)

View File

@ -1,4 +1,4 @@
local pairs, ipairs, select, tinsert, tbl_sort, tostring = pairs, ipairs, select, tinsert, table.sort, tostring
local pairs, ipairs, select, tinsert, tbl_sort, tostring, tonumber, rand = pairs, ipairs, select, tinsert, table.sort, tostring, tonumber, math.random
local GetSpellInfo = GetSpellInfo
local CreateFrame, GetTime = CreateFrame, GetTime
@ -266,28 +266,63 @@ function Auras:ResetUnit(unit)
end
function Auras:Test(unit)
local spellName, _, icon
local spellName, spellid, icon, limit, i
if (unit == "arena1") then
spellName, _, icon = GetSpellInfo(7922)
self:AURA_FADE(unit, AURA_TYPE_BUFF)
self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 7922, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
self:SPELL_INTERRUPT(unit,19244, select(1, GetSpellInfo(19244)), "physical", 25396, select(1, GetSpellInfo(25396)), 64)
elseif (unit == "arena2") then
spellName = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))
_, _, icon = GetSpellInfo(27010)
self:AURA_FADE(unit, AURA_TYPE_BUFF)
self:AURA_FADE(unit,AURA_TYPE_DEBUFF)
self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 27010, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
self:SPELL_INTERRUPT(unit,19244, select(1, GetSpellInfo(19244)), "physical", 25396, select(1, GetSpellInfo(25396)), 64)
elseif (unit == "arena3") then
spellName, _, icon = GetSpellInfo(34709)
self:AURA_FADE(unit, AURA_TYPE_BUFF)
self:AURA_GAIN(unit,AURA_TYPE_BUFF, 34709, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
spellName, _, icon = GetSpellInfo(18425)
--self:AURA_FADE(unit, AURA_TYPE_DEBUFF)
--self:AURA_GAIN(unit,AURA_TYPE_DEBUFF, 18425, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
--Auras
local enabledAuras = 0
for _,value in pairs(Gladdy.db.auraListDefault) do
if value.enabled then
enabledAuras = enabledAuras + 1
end
end
if enabledAuras > 0 then
limit, i = rand(1, enabledAuras), 1
for spellIdStr,value in pairs(Gladdy.db.auraListDefault) do
if i > limit then break end
if value.enabled then
spellid = tonumber(spellIdStr)
spellName = select(1, GetSpellInfo(tonumber(spellIdStr)))
icon = select(3, GetSpellInfo(tonumber(spellIdStr)))
if Gladdy.exceptionNames[spellid] then
spellName = Gladdy.exceptionNames[spellid]
end
self:AURA_GAIN(unit,value.track, spellid, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
i = i + 1
end
end
end
--Interrupts
local spellSchools = {}
for k,_ in pairs(Gladdy:GetSpellSchoolColors()) do
tinsert(spellSchools, k)
end
enabledAuras = 0
for _, value in pairs(Gladdy.db.auraListInterrupts) do
if value.enabled then
enabledAuras = enabledAuras + 1
end
end
if enabledAuras > 0 then
limit, i = rand(1, enabledAuras), 1
local extraSpellSchool
for spellIdStr, value in pairs(Gladdy.db.auraListInterrupts) do
if i > limit then break end
if value.enabled then
enabledAuras = enabledAuras + 1
end
spellid = tonumber(spellIdStr)
if (unit == "arena1" or unit == "arena2") then
extraSpellSchool = spellSchools[rand(1, #spellSchools)]
spellName = select(1, GetSpellInfo(spellid))
Gladdy:Print(spellName, extraSpellSchool)
self:SPELL_INTERRUPT(unit,spellid, spellName, "physical", spellid, spellName, extraSpellSchool)
end
i = i + 1
end
end
end

View File

@ -1,5 +1,5 @@
local select = select
local pairs,ipairs,tbl_sort,tinsert,format = pairs,ipairs,table.sort,tinsert,format
local pairs,ipairs,tbl_sort,tinsert,format,rand = pairs,ipairs,table.sort,tinsert,format,math.random
local GetSpellInfo = GetSpellInfo
local CreateFrame = CreateFrame
@ -261,7 +261,7 @@ function Diminishings:Test(unit)
for spellID,category in pairs(DRData:GetSpells()) do
if Gladdy.db.drCategories[category].enabled then
if not limit[category] then
limit[category] = { count = 1, limit = math.random(1,3) }
limit[category] = { count = 1, limit = rand(1,3) }
else
limit[category].count = limit[category].count + 1
end