/
## Interface: 30100 |
## Title: |cFFFFB366Ara|r - Dotimer |
## Version: b9b |
## Version: r9 |
## Author: Ara |
## Notes: Provides a display for multiple target debuff tracking. Type "/dot" or "/dt" to move/scale the display (right-click the window after you're done positioning). |
## Dependencies: |
- dontFade/vanish attribute to zap some fade effect |
]] |
local _, playerClass = UnitClass("player") |
local _, playerClass = UnitClass"player" |
local spells = {} |
--[[*Mind Freeze ]] { timer = 4, dontFade=true, SPELL_INTERRUPT=true }, 47528, -- Mind Freeze (SPELL_INTERRUPT) |
--[[ Plague Strike ]] { timer = 12, talentTree=3, talentIndex=4, talentAdd=3 }, 55078, 57601, 58840, 58844, -- Blood Plague (Plague Strike dot) |
--[[ Strangulate ]] { timer = 5, dontFade=true, dr=true }, 47476, 49913, 49914, 49915, 49916, |
--[[ Rune of Razorice ]]{ timer = 20, dontFade=true }, 51714 |
--[[ Rune of Razorice ]]{ timer = 20, dontFade=true }, 51714, |
--[[ Glyph.Blood Boil ]]{ timer = 5, dontFade=true }, 58617 |
) |
elseif playerClass == "PRIEST" then |
focusBorder:SetAlpha(1) |
focusBorder:SetWidth( focus.header:GetWidth()+BORDER_GAP*2) |
focusBorder:SetHeight( focus.header:GetHeight() + offsetHeader + 16 + BORDER_GAP*2 ) |
-- if config.timersGrowRight then |
-- focusBorder:SetPoint( "TOPLEFT", frame, "TOPLEFT", -BORDER_GAP*1, -offsetTarget*target.pos +BORDER_GAP*1 ) |
-- else |
-- focusBorder:SetPoint( "TOPLEFT", frame, "TOPRIGHT", BORDER_GAP*1, -offsetTarget*target.pos +BORDER_GAP*1 ) |
-- end |
focusBorder:SetPoint( "TOPLEFT", frame, config.timersGrowRight and "TOPLEFT" or "TOPRIGHT", config.timersGrowRight and -BORDER_GAP or -focusBorder:GetWidth()+BORDER_GAP, -offsetTarget*focus.pos +BORDER_GAP ) |
-- focusBorder:SetPoint( "TOPLEFT", frame, "TOPLEFT", -BORDER_GAP, -offsetTarget*focus.pos +BORDER_GAP ) |
-- focusBorder:SetWidth( focus.header:GetWidth()+BORDER_GAP*2) |
-- focusBorder:SetHeight( focus.header:GetHeight() + offsetHeader + 16 + BORDER_GAP*2 ) |
focus.focused = true |
or focusGUID==guid and focusLevel or UnitGUID"mouseover"==guid and UnitLevel"mouseover" or 0 |
if target.level==0 then |
target.level="??" |
else |
if target.level==-1 then target.level = "BOSS" end |
elseif target.level==-1 then |
target.level = "BOSS" |
end |
targets[guid] = target |
nbTargets = nbTargets + 1 |
if nbTargets == 1 then |
frame:SetScript("OnUpdate",OnUpdate) |
end |
elseif spell.group then -- retirer la curse/corruption(seed) deja présente (TODO:étendre aux sorts monocibles) |
elseif spell.group then -- curses & co |
for sp in next, target.timers do |
if sp.group == spell.group then |
RemoveTimer( target, sp, true ) |
timer = AcquireTable( "name", spell.name, "fs", AcquireFS() ) |
timers[spell] = timer |
target.nbTimers = target.nbTimers + 1 |
-- TODO: increase targetBorder width |
end |
local spellTimer, duration = offset or spell.timer |
end |
end |
local events = { |
["SPELL_AURA_APPLIED"] = true, |
["SPELL_AURA_REFRESH"] = true, |
["SPELL_AURA_REMOVED"] = true, |
["SPELL_INTERRUPT"] = true, |
["SPELL_AURA_APPLIED_DOSE"] = true, |
["SPELL_AURA_REMOVED_DOSE"] = true, |
["UNIT_DIED"] = true, |
["UNIT_DESTROYED"] = true, |
} |
local function OnCombatEvent( self, event, timestamp, combatEvent, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, ... ) |
if not events[event] then return end |
if srcGUID == playerGUID or srcFlags == 0x1111 --[[ pet ]] then |
-- target must be unfriendly |
if bit_and( dstFlags, COMBATLOG_OBJECT_REACTION_HOSTILE + COMBATLOG_OBJECT_REACTION_NEUTRAL ) == 0 then return end |
if not target then return end |
local timer = target.timers[ spells[...] ] |
if not timer then return end |
-- TODO: if spell.fade then expiretime = now-0.001 else removetimer end |
timer.expireTime = GetTime() - 0.001 |
-- return RemoveTimer( target, spells[...] ) |
if spell.dontFade then RemoveTimer(target, spells[...]) else timer.expireTime = GetTime() - 0.001 end |
elseif combatEvent == "SPELL_INTERRUPT" then -- TODO: merge with SPELL_AURA_APPLIED ? |
local spell = spells[...] |
if spell then return AddTimer( dstGUID, dstName, spell, GetTime() ) end |
elseif combatEvent == "SPELL_AURA_APPLIED_DOSE" or combatEvent == "SPELL_AURA_REMOVED_DOSE" then |
else--if combatEvent == "SPELL_AURA_APPLIED_DOSE" or combatEvent == "SPELL_AURA_REMOVED_DOSE" then |
local spellID, _, _, _, nbDose = ... |
local spell = spells[spellID] |
if not spell then return end |
targetGUID, targetLevel = UnitGUID"target", UnitLevel"target" |
if nbTargets == 0 then return end |
local target = targets[targetGUID] |
if targeted and targeted ~= target or target then SetTargetHL(target) end |
if targeted and targeted ~= target or target then return SetTargetHL(target) end |
elseif event == "PLAYER_FOCUS_CHANGED" then |
focusGUID = UnitGUID"focus" |
focusLevel = UnitLevel"focus" |
if nbTargets == 0 then return end |
local focus = targets[focusGUID] |
if focused and focused ~= focus or focus then SetFocusHL(focus) end |
if focused and focused ~= focus or focus then return SetFocusHL(focus) end |
elseif event == "PLAYER_REGEN_ENABLED" then |
-- fin du combat, on vire les mobs qui ont reset |
for guid in next, targets do |
for guid in next, targets do |
RemoveTarget( guid ) |
end |
elseif event == "CHARACTER_POINTS_CHANGED" then |
elseif event == "PLAYER_TALENT_UPDATE" then |
for id, spell in next, spells do |
if spell.talentTree then spell.hasTalent = nil end |
end |
frame:RegisterEvent"PLAYER_FOCUS_CHANGED" |
frame:RegisterEvent"PLAYER_REGEN_ENABLED" |
frame:RegisterEvent"PLAYER_DEAD" |
frame:RegisterEvent"CHARACTER_POINTS_CHANGED" |
frame:RegisterEvent"PLAYER_TALENT_UPDATE" |
frame:RegisterEvent"GLYPH_ADDED" frame:RegisterEvent"GLYPH_REMOVED" frame:RegisterEvent"GLYPH_UPDATED" |
frame:RegisterEvent"ADDON_LOADED" |