Skip to content

Commit

Permalink
Fix incapacitated backup alert
Browse files Browse the repository at this point in the history
  • Loading branch information
Slivo-fr committed Jan 17, 2022
1 parent 9c76ed8 commit 0fe8484
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
4 changes: 2 additions & 2 deletions TranqRotate.toc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Interface: 11401
## Title: TranqRotate |cff00aa002.2.2|r
## Title: TranqRotate |cff00aa002.2.3|r
## Notes: A tranqshot rotation assistant
## Author: Slivo
## Version: 2.2.2
## Version: 2.2.3
## SavedVariables: TranqRotateDb
## OptionalDeps: Ace3

Expand Down
4 changes: 2 additions & 2 deletions TranqRotate_TBC.toc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Interface: 20502
## Title: TranqRotate |cff00aa002.2.2|r
## Title: TranqRotate |cff00aa002.2.3|r
## Notes: A tranqshot rotation assistant
## Author: Slivo
## Version: 2.2.2
## Version: 2.2.3
## SavedVariables: TranqRotateDb
## OptionalDeps: Ace3

Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## TranqRotate Changelog

#### v2.2.3

- Incapacitated backup alert should now work properly

#### v2.2.2

- Bump toc for 1.14.1
Expand Down
23 changes: 14 additions & 9 deletions src/debuff.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
-- Checks if player is incapacitated by a debuff for too long
function TranqRotate:isPlayedIncapacitatedByDebuff()

for i, debuffId in ipairs(TranqRotate.constants.incapacitatingDebuffs) do
local name, expirationTime = TranqRotate:getPlayerDebuff(debuffId)
if (name and expirationTime - GetTime() > TranqRotate.db.profile.incapacitatedDelay) then
return true
end
end

local name, _, _, _, _, expirationTime, _, _, _, spellId, _, isBossDebuff
= AuraUtil.FindAuraByName(GetSpellInfo(debuffId), "player")
return false
end

if (name) then
print(name, expirationTime - GetTime(), spellId, isBossDebuff)
function TranqRotate:getPlayerDebuff(debuffId)
for i=1, 32, 1 do
local name, icon, count, dispelType, duration, expirationTime, source, isStealable, nameplateShowPersonal,
spellId, canApplyAura, isBossDebuff, castByPlayer, nameplateShowAll, timeMod = UnitDebuff("player", i)

if (expirationTime - GetTime() > TranqRotate.constants.incapacitatedDelay) then
return true
end
if (spellId and spellId == debuffId) then
return name, expirationTime
end
end

return false
return nil
end

0 comments on commit 0fe8484

Please sign in to comment.