--Code provided by Xelper
local targetTrapped = UnitDebuffID("target", 1499)
local _, FreezingTrapCD = GetSpellCooldown(1499)
if targetTrapped then
return true
end
if FreezingTrapTimeout ~= nil and FreezingTrapTimeout > GetTime() then
local targetName = UnitName("target")
if targetName == FreezingTrapTarget and FreezingTrapTarget ~= nil then
if FreezingTrapCD > 3 then
return true
end
end
else
FreezingTrapTimeout = nil
FreezingTrapTarget = nil
end
if IsLeftControlKeyDown() and GetCurrentKeyBoardFocus() == nil then
local ScatterShot = GetSpellInfo(19503)
local TrapLauncher = GetSpellInfo(77769)
local FreezingTrap = GetSpellInfo(1499)
local ScatterShotCD, ScatterDuration = GetSpellCooldown(19503)
ScatterShotCD = ScatterShotCD - GetTime() + ScatterDuration
local TrapLauncherBuff = UnitBuffID("player", 77769)
if ScatterShotCD < 3 and FreezingTrapCD < 3 then
CastSpellByName(ScatterShot, "mouseover")
return true
end
if ScatterShotCD > 20 and FreezingTrapCD < 3 and TrapLauncherBuff == nil then
CastSpellByName(TrapLauncher)
return true
end
if ScatterShotCD > 20 and FreezingTrapCD < 3 and TrapLauncherBuff then
RunMacroText("/cast "..FreezingTrap)
if FreezingTrapTimeout == nil or FreezingTrapTarget == nil then
FreezingTrapTarget = UnitName("mouseover")
end
FreezingTrapTimeout = GetTime() + 3
local PQR_TargetName = UnitName("target")
local friendPlates = GetCVar("nameplateShowFriends")
local enemyPlates = GetCVar("nameplateShowEnemies")
SetCVar("nameplateShowFriends", 0)
SetCVar("nameplateShowEnemies", 0)
CameraOrSelectOrMoveStart()
CameraOrSelectOrMoveStop()
SetCVar("nameplateShowFriends", friendPlates)
SetCVar("nameplateShowEnemies", enemyPlates)
local PQR_TargetNameNew = UnitName("target")
if PQR_TargetName ~= nil then
if PQR_TargetName ~= PQR_TargetNameNew then
TargetLastTarget()
end
else
ClearTarget()
end
return true
end
end