/
KHT_NUM_TABS = 5; |
KHT_NUM_TIMERS = { |
[1] = 24, -- Specializations |
[1] = 20, -- Specializations |
[2] = 25, -- Talents |
[3] = 14, -- Common |
[4] = 9, -- Pets |
[3] = KHT_ASPECT_WILD, |
[4] = KHT_BEAST_CLEAVE, |
[5] = KHT_BESTIAL_WRATH, |
[6] = KHT_BOMBARDMENT, |
[7] = KHT_BURST_SHOT, |
[8] = KHT_CONCUSS_SHOT, |
[9] = KHT_COUNTER_SHOT, |
[10] = KHT_DIRE_BEAST, |
[11] = KHT_EXPLOSIVE_TRAP, |
[12] = KHT_FREEZING_TRAP, |
[13] = KHT_HARPOON, |
[14] = KHT_HUNTERS_MARK, |
[15] = KHT_LACERATE, |
[16] = KHT_MARKING, |
[17] = KHT_MISDIRECTION, |
[18] = KHT_MONGOOSE_FURY, |
[19] = KHT_MUZZLE, |
[20] = KHT_SURVIVALIST, |
[21] = KHT_TAR_TRAP, |
[22] = KHT_TRUESHOT, |
[23] = KHT_VULNERABLE, |
[24] = KHT_WING_CLIP |
[6] = KHT_BURST_SHOT, |
[7] = KHT_CONCUSS_SHOT, |
[8] = KHT_COUNTER_SHOT, |
[9] = KHT_DIRE_BEAST, |
[10] = KHT_EXPLOSIVE_TRAP, |
[11] = KHT_FREEZING_TRAP, |
[12] = KHT_HARPOON, |
[13] = KHT_LACERATE, |
[14] = KHT_MISDIRECTION, |
[15] = KHT_MONGOOSE_FURY, |
[16] = KHT_MUZZLE, |
[17] = KHT_SURVIVALIST, |
[18] = KHT_TAR_TRAP, |
[19] = KHT_TRUESHOT, |
[20] = KHT_WING_CLIP |
}, |
[2] = { -- Talents |
[1] = KHT_TALENT, |
[2] = KHT_MURDER_CROWS, |
[3] = KHT_BESTIAL_CUNNING, |
[4] = KHT_BESTIAL_FEROCITY, |
[5] = KHT_BESTIAL_TENACITY, |
[6] = KHT_BINDING_SHOT, |
[7] = KHT_BLACK_ARROW, |
[8] = KHT_CALTROPS, |
[9] = KHT_CAMO, |
[10] = KHT_CAREFUL_AIM, |
[11] = KHT_DIRE_FRENZY, |
[3] = KHT_BARBED_SHOT, |
[4] = KHT_BESTIAL_CUNNING, |
[5] = KHT_BESTIAL_FEROCITY, |
[6] = KHT_BESTIAL_TENACITY, |
[7] = KHT_BINDING_SHOT, |
[8] = KHT_BLACK_ARROW, |
[9] = KHT_CALTROPS, |
[10] = KHT_CAMO, |
[11] = KHT_CAREFUL_AIM, |
[12] = KHT_DRAGON_GRENADE, |
[13] = KHT_INTIM, |
[14] = KHT_LOCK_LOAD, |
local khtCarve = false; |
local khtPetIntim = false; |
local khtSerpentAoE = false; |
local khtDireFrenzy = 0; |
local khtFrenzy = 0; |
local khtLacerate = 0 |
local khtLockLoad = 0; |
local khtMokNathal = 0 |
local khtSerpent = 0; |
local khtSurvivalist = 0 |
local khtTrueAim = 0 |
local khtVulnerable = 0 |
local khtBarbedShot = 0 |
local khtTimeLeft = nil; |
end |
if ( event == "COMBAT_LOG_EVENT_UNFILTERED" ) then |
local _, combatEvent, _, sourceGUID, sourceName, sourceFlags, _, destGUID, destName, destFlags, _, spellId, spellName = ...; |
local _, combatEvent, _, sourceGUID, sourceName, sourceFlags, _, destGUID, destName, destFlags, _, spellId, spellName = CombatLogGetCurrentEventInfo() |
local toPlayer, fromPlayer, toPet, fromPet, toTarget; |
if (sourceName and not CombatLog_Object_IsA(sourceFlags, COMBATLOG_OBJECT_NONE) ) then |
KHunterTimersFrame_add( 4000, spellName, spellId ) |
elseif( KHTvars["skills"][KHT_BESTIAL_WRATH] and spellName == KHT_BESTIAL_WRATH and spellId == 19574 ) then |
KHunterTimersFrame_add( 15000, spellName, spellId ) |
elseif( KHTvars["skills"][KHT_BOMBARDMENT] and spellName == KHT_BOMBARDMENT ) then |
KHunterTimersFrame_add( 5000, spellName, spellId ) |
elseif( KHTvars["skills"][KHT_DIRE_BEAST] and spellName == KHT_DIRE_BEAST ) then |
KHunterTimersFrame_add( 8000, spellName, spellId ) |
elseif( KHTvars["skills"][KHT_MARKING] and spellName == KHT_MARKING ) then |
KHunterTimersFrame_add( 15000, spellName, spellId ); |
elseif( KHTvars["skills"][KHT_MISDIRECTION] and spellName == KHT_MISDIRECTION and spellId == 35079 ) then |
KHunterTimersFrame_add( 8000, spellName, spellId ); |
elseif( KHTvars["skills"][KHT_TRUESHOT] and spellName == KHT_TRUESHOT ) then |
end |
elseif( KHTvars["skills"][KHT_HARPOON] and spellName == KHT_HARPOON ) then |
KHunterTimersFrame_add( 3000, spellName, spellId, destName, destGUID ) |
elseif( KHTvars["skills"][KHT_HUNTERS_MARK] and spellName == KHT_HUNTERS_MARK ) then |
KHunterTimersFrame_add( 12000, spellName, spellId, destName, destGUID ) |
elseif( KHTvars["skills"][KHT_MUZZLE] and spellName == KHT_MUZZLE ) then |
KHunterTimersFrame_add( 3000, spellName, spellId, destName, destGUID ) |
elseif( KHTvars["skills"][KHT_WING_CLIP] and spellName == KHT_WING_CLIP ) then |
if( KHTvars["skills"][KHT_SPECIAL] ) then |
if( KHTvars["skills"][KHT_BEAST_CLEAVE] and spellName == KHT_BEAST_CLEAVE ) then |
KHunterTimersFrame_add( 4000, spellName, spellId ) |
elseif( KHTvars["skills"][KHT_BOMBARDMENT] and spellName == KHT_BOMBARDMENT ) then |
KHunterTimersFrame_add( 5000, spellName, spellId ) |
elseif( KHTvars["skills"][KHT_MARKING] and spellName == KHT_MARKING ) then |
KHunterTimersFrame_add( 15000, spellName, spellId ); |
elseif( KHTvars["skills"][KHT_MISDIRECTION] and spellName == KHT_MISDIRECTION and spellId == 35079 ) then |
KHunterTimersFrame_add( 8000, spellName, spellId ); |
end |
if( KHTvars["skills"][KHT_SPECIAL] ) then |
if( KHTvars["skills"][KHT_CONCUSS_SHOT] and spellName == KHT_CONCUSS_SHOT ) then |
KHunterTimersFrame_add( 6000, spellName, spellId, destName, destGUID ) |
elseif( KHTvars["skills"][KHT_HUNTERS_MARK] and spellName == KHT_HUNTERS_MARK ) then |
KHunterTimersFrame_add( 12000, spellName, spellId, destName, destGUID ) |
elseif( KHTvars["skills"][KHT_WING_CLIP] and spellName == KHT_WING_CLIP ) then |
KHunterTimersFrame_add( 15000, spellName, spellId, destName, destGUID ) |
end |
elseif( event == "UNIT_AURA" and firstArg == "player" ) then |
if( KHTvars["skills"][KHT_SPECIAL] ) then |
if( KHTvars["skills"][KHT_MONGOOSE_FURY] ) then |
local spellName, _, _, count, _, duration, timeLeft, _, _, _, spellId = UnitBuff("player", KHT_MONGOOSE_FURY, nil ); |
local spellName, _, count, _, duration, timeLeft, _, _, _, spellId = AuraUtil.FindAuraByName(KHT_MONGOOSE_FURY, "player", "HELPFUL"); |
if( spellName and timeLeft ~= khtMongoose ) then |
duration = timeLeft - GetTime(); |
KHunterTimersFrame_add( duration*1000, spellName, spellId, nil, nil, count ); |
end |
end |
if( KHTvars["skills"][KHT_SURVIVALIST] ) then |
local spellName, _, _, _, _, duration, timeLeft, _, _, _, spellId = UnitBuff("player", KHT_SURVIVALIST, nil ); |
local spellName, _, _, _, duration, timeLeft, _, _, _, spellId = AuraUtil.FindAuraByName(KHT_SURVIVALIST, "player", "HELPFUL"); |
if( spellName and timeLeft ~= khtSurvivalist ) then |
duration = timeLeft - GetTime(); |
KHunterTimersFrame_add( duration*1000, spellName, spellId ); |
end |
if( KHTvars["skills"][KHT_TALENT] ) then |
if( KHTvars["skills"][KHT_MOKNATHAL] ) then |
local spellName, _, _, count, _, duration, timeLeft, _, _, _, spellId = UnitBuff("player", KHT_MOKNATHAL, nil ); |
local spellName, _, count, _, duration, timeLeft, _, _, _, spellId = AuraUtil.FindAuraByName(KHT_MOKNATHAL, "player", "HELPFUL"); |
if( spellName and timeLeft ~= khtMokNathal ) then |
duration = timeLeft - GetTime(); |
KHunterTimersFrame_add( duration*1000, spellName, spellId, nil, nil, count ); |
end |
end |
if( KHTvars["skills"][KHT_LOCK_LOAD] ) then |
local spellName, _, _, count, _, duration, timeLeft, _, _, _, spellId = UnitBuff("player", KHT_LOCK_LOAD, nil ); |
local spellName, _, count, _, duration, timeLeft, _, _, _, spellId = AuraUtil.FindAuraByName(KHT_LOCK_LOAD, "player", "HELPFUL"); |
if( spellName and timeLeft ~= khtLockLoad ) then |
duration = timeLeft - GetTime(); |
KHunterTimersFrame_add( duration*1000, spellName, spellId, nil, nil, count ); |
end |
elseif( event == "UNIT_AURA" and firstArg == "pet" ) then |
if( KHTvars["skills"][KHT_TALENT] ) then |
if( KHTvars["skills"][KHT_DIRE_FRENZY] ) then |
local spellName, _, _, count, _, duration, timeLeft, _, _, _, spellId = UnitBuff("pet", KHT_DIRE_FRENZY, nil ); |
if( spellName and timeLeft ~= khtDireFrenzy ) then |
if( KHTvars["skills"][KHT_BARBED_SHOT] ) then |
local spellName, _, count, _, duration, timeLeft, _, _, _, spellId = AuraUtil.FindAuraByName(KHT_FRENZY, "pet", "HELPFUL"); |
if( spellName and timeLeft ~= khtFrenzy ) then |
duration = timeLeft - GetTime(); |
KHunterTimersFrame_add( duration*1000, spellName, spellId, nil, nil, count ); |
khtDireFrenzy = timeLeft; |
khtFrenzy = timeLeft; |
end |
end |
end |
elseif( event == "UNIT_AURA" and firstArg == "target" ) then |
if( KHTvars["skills"][KHT_SPECIAL] ) then |
if( KHTvars["skills"][KHT_LACERATE] ) then |
local spellName, _, _, _, _, duration, timeLeft, unitCaster, _, _, spellId = UnitDebuff("target", KHT_LACERATE, nil ); |
local spellName, _, _, _, duration, timeLeft, unitCaster, _, _, spellId = AuraUtil.FindAuraByName(KHT_LACERATE, "target", "HARMFUL"); |
if( spellName and unitCaster == "player" and timeLeft ~= khtLacerate ) then |
duration = timeLeft - GetTime(); |
KHunterTimersFrame_add( duration*1000, spellName, spellId, UnitName("target"), UnitGUID("target") ); |
khtLacerate = timeLeft; |
end |
end |
if( KHTvars["skills"][KHT_VULNERABLE] ) then |
local spellName, _, _, count, _, duration, timeLeft, unitCaster, _, _, spellId = UnitDebuff("target", KHT_VULNERABLE, nil ); |
if( spellName and unitCaster == "player" and timeLeft ~= khtVulnerable ) then |
duration = timeLeft - GetTime(); |
KHunterTimersFrame_add( duration*1000, spellName, spellId, UnitName("target"), UnitGUID("target"), count ); |
khtVulnerable = timeLeft; |
end |
end |
end |
if( KHTvars["skills"][KHT_TALENT] ) then |
if( KHTvars["skills"][KHT_SERPENT_STING] ) then |
local spellName, _, _, _, _, duration, timeLeft, unitCaster, _, _, spellId = UnitDebuff("target", KHT_SERPENT_STING, nil ); |
local spellName, _, _, _, duration, timeLeft, unitCaster, _, _, spellId = AuraUtil.FindAuraByName(KHT_SERPENT_STING, "target", "HARMFUL"); |
if( spellName and unitCaster == "player" and timeLeft ~= khtSerpent ) then |
duration = timeLeft - GetTime(); |
KHunterTimersFrame_add( duration*1000, spellName, spellId, UnitName("target"), UnitGUID("target") ); |
end |
end |
if( KHTvars["skills"][KHT_TRUE_AIM] ) then |
local spellName, _, _, count, _, duration, timeLeft, unitCaster, _, _, spellId = UnitDebuff("target", KHT_TRUE_AIM, nil ); |
local spellName, _, count, _, duration, timeLeft, unitCaster, _, _, spellId = AuraUtil.FindAuraByName(KHT_TRUE_AIM, "target", "HARMFUL"); |
if( spellName and unitCaster == "player" and timeLeft ~= khtTrueAim ) then |
duration = timeLeft - GetTime(); |
KHunterTimersFrame_add( duration*1000, spellName, spellId, UnitName("target"), UnitGUID("target"), count ); |
khtTrueAim = timeLeft; |
end |
end |
if( KHTvars["skills"][KHT_BARBED_SHOT] ) then |
local spellName, _, count, _, duration, timeLeft, unitCaster, _, _, spellId = AuraUtil.FindAuraByName(KHT_BARBED_SHOT, "target", "HARMFUL"); |
if( spellName and unitCaster == "player" and timeLeft ~= khtBarbedShot ) then |
duration = timeLeft - GetTime(); |
KHunterTimersFrame_add( duration*1000, spellName, spellId, UnitName("target"), UnitGUID("target"), count ); |
khtBarbedShot = timeLeft; |
end |
end |
end |
elseif( event == "UNIT_SPELLCAST_SUCCEEDED" and firstArg == "player" ) then |
if( KHTvars["skills"][KHT_SPECIAL] ) then |
if( secondArg == KHT_FREEZING_TRAP ) then |
if( KHTvars["skills"][secondArg] ) then |
if( thirdArg == 187650 ) then |
if( KHTvars["skills"][KHT_FREEZING_TRAP] ) then |
frostTrapTimer = true; |
KHunterTimersFrame_add( 60000, secondArg.." "..KHT_PRIMED, 187650 ); |
KHunterTimersFrame_add( 60000, KHT_FREEZING_TRAP.." "..KHT_PRIMED, thirdArg ); |
end |
elseif( secondArg == KHT_EXPLOSIVE_TRAP ) then |
if( KHTvars["skills"][secondArg] ) then |
elseif( thirdArg == 191433 ) then |
if( KHTvars["skills"][KHT_EXPLOSIVE_TRAP] ) then |
fireTrapTimer = true; |
KHunterTimersFrame_add( 60000, secondArg.." "..KHT_PRIMED, 191433 ); |
KHunterTimersFrame_add( 60000, KHT_EXPLOSIVE_TRAP.." "..KHT_PRIMED, thirdArg ); |
end |
elseif( secondArg == KHT_TAR_TRAP ) then |
if( KHTvars["skills"][secondArg] ) then |
elseif( thirdArg == 187698 ) then |
if( KHTvars["skills"][KHT_TAR_TRAP] ) then |
natureTrapTimer = true; |
KHunterTimersFrame_add( 60000, secondArg.." "..KHT_PRIMED, 187698 ); |
KHunterTimersFrame_add( 60000, KHT_TAR_TRAP.." "..KHT_PRIMED, thirdArg ); |
end |
end |
end |
if( KHTvars["skills"][KHT_TALENT] ) then |
if( secondArg == KHT_STEEL_TRAP ) then |
if( KHTvars["skills"][secondArg] ) then |
if( thirdArg == 162488 ) then |
if( KHTvars["skills"][KHT_STEEL_TRAP] ) then |
steelTrapTimer = true; |
KHunterTimersFrame_add( 60000, secondArg.." "..KHT_PRIMED, 162488 ); |
KHunterTimersFrame_add( 60000, KHT_STEEL_TRAP.." "..KHT_PRIMED, thirdArg ); |
end |
end |
end |
if( KHTvars["skills"][KHT_COMMON] ) then |
if( KHTvars["skills"][KHT_AUTO_SHOT] and secondArg == KHT_AUTO_SHOT ) then |
if( KHTvars["skills"][KHT_AUTO_SHOT] and thirdArg == 75 ) then |
khtAutoShot = true; |
khtTimeLeft = UnitRangedDamage("player"); |
KHunterTimersFrame_add( khtTimeLeft*1000, KHT_AUTO_SHOT, 75 ); |
KHunterTimersFrame_add( khtTimeLeft*1000, KHT_AUTO_SHOT, thirdArg ); |
end |
end |
end |
khtCarve = false; |
khtPetIntim = false; |
khtSerpentAoE = false; |
khtDireFrenzy = 0; |
khtFrenzy = 0; |
khtLacerate = 0 |
khtLockLoad = 0; |
khtMokNathal = 0; |
khtSerpent = 0; |
khtSurvivalist = 0 |
khtTrueAim = 0 |
khtVulnerable = 0 |
khtBarbedShot = 0 |
end |
Version History |
v4.3.0 |
- Fixed errors in 8.0 patch |
v4.2.2 |
- Fixed PlaySound errors |
v4.2.1 |
## Interface: 70300 |
## Interface: 80000 |
## Title: Kharthus's Hunter Timers |
## Notes: Times hunter buffs/debuffs |
## Version: 4.2.2 |
## Version: 4.3.0 |
## DefaultState: Enabled |
## LoadOnDemand: 0 |
## SavedVariables: KHTvars |
KHT_ASPECT_WILD = GetSpellInfo(193530) -- Aspect of the Wild |
KHT_BEAST_CLEAVE = GetSpellInfo(115939) -- Beast Cleave |
KHT_BESTIAL_WRATH = GetSpellInfo(19574) -- Bestial Wrath |
KHT_BOMBARDMENT = GetSpellInfo(35110) -- Bombardment |
KHT_BURST_SHOT = GetSpellInfo(186387) -- Bursting Shot |
KHT_CONCUSS_SHOT = GetSpellInfo(5116) -- Concussive Shot |
KHT_COUNTER_SHOT = GetSpellInfo(147362) -- Counter Shot |
KHT_EXPLOSIVE_TRAP = GetSpellInfo(191433) -- Explosive Trap |
KHT_FREEZING_TRAP = GetSpellInfo(187650) -- Freezing Trap |
KHT_HARPOON = GetSpellInfo(190925) -- Harpoon |
KHT_HUNTERS_MARK = GetSpellInfo(185987) -- Hunter's Mark |
KHT_LACERATE = GetSpellInfo(185855) -- Lacerate |
KHT_MARKING = GetSpellInfo(223138) -- Marking Targets |
KHT_MISDIRECTION = GetSpellInfo(34477) -- Misdirection |
KHT_MONGOOSE_FURY = GetSpellInfo(190931) -- Mongoose Fury |
KHT_MUZZLE = GetSpellInfo(187707) -- Muzzle |
KHT_SURVIVALIST = GetSpellInfo(164856) -- Survivalist |
KHT_TAR_TRAP = GetSpellInfo(187698) -- Tar Trap |
KHT_TRUESHOT = GetSpellInfo(193526) -- Trueshot |
KHT_VULNERABLE = GetSpellInfo(187131) -- Vulnerable |
KHT_WING_CLIP = GetSpellInfo(195645) -- Wing Clip |
-- Talents |
KHT_CAMO = GetSpellInfo(199483) -- Camouflage |
KHT_CAREFUL_AIM = GetSpellInfo(53238) -- Careful Aim |
KHT_CARVE = GetSpellInfo(187708) -- Carve |
KHT_DIRE_FRENZY = GetSpellInfo(217200) -- Dire Frenzy |
KHT_BARBED_SHOT = GetSpellInfo(217200) -- Barbed Shot |
KHT_DRAGON_GRENADE = GetSpellInfo(194855) -- Dragonsfire Grenade |
KHT_INTIM = GetSpellInfo(24394) -- Intimidation |
KHT_LOCK_LOAD = GetSpellInfo(194595) -- Lock and Load |
KHT_SHELL_SHIELD = GetSpellInfo(26064) -- Shell Shield |
KHT_SPIRIT_MEND = GetSpellInfo(90361) -- Spirit Mend |
KHT_WARP_TIME = GetSpellInfo(35346) -- Warp Time |
KHT_FRENZY = GetSpellInfo(272790) -- Frenzy |
KHT_MISC = "Enable 'Miscellaneous' Timers"; |
KHT_TRINKETS = "Enable 'Trinket' Timers"; |