perception cd tracking improved (rogue out of stealth)

This commit is contained in:
Sumsebrum 2022-01-14 03:06:02 +01:00
parent 874d8471e8
commit 89a5511fb9
2 changed files with 15 additions and 2 deletions

View File

@ -86,6 +86,9 @@ function Gladdy:SpotEnemy(unit, auraScan)
end
end
end
if Gladdy.cooldownBuffs.racials[spellName] then
Gladdy:SendMessage("RACIAL_USED", unit, expirationTime, spellName)
end
if Gladdy.specBuffs[spellName] then -- Check for auras that detect a spec
local unitPet = string_gsub(unit, "%d$", "pet%1")
if UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster) then
@ -216,6 +219,9 @@ Gladdy.exceptionNames = { -- TODO MOVE ME TO CLASSBUFFS LIB
Gladdy.cooldownBuffs = {
[GetSpellInfo(6346)] = { cd = 180, spellId = 6346 }, -- Fear Ward
racials = {
[GetSpellInfo(20600)] = { cd = 180, spellId = 20600 }, -- Perception
}
}
function EventListener:UNIT_AURA(unit)
@ -243,6 +249,9 @@ function EventListener:UNIT_AURA(unit)
end
end
end
if Gladdy.cooldownBuffs.racials[spellName] then
Gladdy:SendMessage("RACIAL_USED", unit, spellName, expirationTime, spellName)
end
if not button.spec and Gladdy.specBuffs[spellName] then
local unitPet = string_gsub(unit, "%d$", "pet%1")
if unitCaster and (UnitIsUnit(unit, unitCaster) or UnitIsUnit(unitPet, unitCaster)) then

View File

@ -165,13 +165,17 @@ function Racial:JOINED_ARENA()
end)
end
function Racial:RACIAL_USED(unit)
function Racial:RACIAL_USED(unit, expirationTime, spellName)
local racial = self.frames[unit]
local button = Gladdy.buttons[unit]
if (not racial or not button or not button.race) then
return
end
Racial:Used(unit, GetTime(), Gladdy:Racials()[button.race].duration)
if expirationTime and Gladdy:Racials()[button.race].spellName ~= spellName then
return
end
local startTime = (expirationTime and expirationTime - Gladdy:Racials()[button.race].duration) or GetTime()
Racial:Used(unit, startTime, Gladdy:Racials()[button.race].duration)
end
function Racial:Used(unit, startTime, duration)