Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.39 KB | None | 0 0
  1. local function target_unit(id)
  2.     if dark_addon.luaboxdev then
  3.         __LB__.UnitTagHandler(TargetUnit, id)
  4.     elseif dark_addon.adv_protected then
  5.         local obj = GetObjectWithGUID(id)
  6.         TargetUnit(GetObjectWithGUID(id))
  7.     end
  8.     faceTarget()
  9. end
  10. setfenv(target_unit, dark_addon.environment.env)
  11.  
  12.  
  13.  
  14. local function spreadMyDots()
  15.   if not toggle("interrupts", false) then
  16.       return
  17.   end
  18.   if not castable("Corruption") then
  19.       return
  20.   end
  21.   if checkDOTz() == false then
  22.       return
  23.   end
  24.   local multi = dark_addon.settings.fetch("classic_warlock_multiTarget", false)
  25.   local saved_target = nil
  26.   local unit = nil
  27.   if target.exists and target.alive and multi then
  28.       saved_target = target.guid
  29.   end
  30.   if multi then
  31.       unit =
  32.           enemies.match(
  33.           function(unit)
  34.               return unit.exists and unit.alive and unit.in_range("Corruption") and unit.combat
  35.           end
  36.       )
  37.   elseif target.exists and target.alive and target.in_range("Corruption") and target.combat then
  38.       unit = target
  39.   else
  40.       unit = false
  41.   end
  42.   if unit ~= false and IsSpellKnown(172) and not spell("Corruption").lastcast and canCast("Corruption") and target.debuff("Corruption").down and GetTime() - timeForCorruption > 1.5 then
  43.     timeForCorruption = GetTime() then
  44.       if multi then
  45.           target_unit(unit.guid)
  46.       end
  47.       cast("Corruption", "target")
  48.       if saved_target ~= nil and multi then
  49.           target_unit(saved_target)
  50.       end
  51.       return true
  52.   end
  53.   if unit ~= false and target.debuff("Immolate").down then
  54.     if multi then
  55.         target_unit(unit.guid)
  56.     end
  57.     cast("Immolate", "target")
  58.     if saved_target ~= nil and multi then
  59.         target_unit(saved_target)
  60.     end
  61.     return true
  62.   end
  63.   if unit ~= false and target.debuff("Curse of Agony").down then
  64.     if multi then
  65.         target_unit(unit.guid)
  66.     end
  67.     cast("Curse of Agony", "target")
  68.     if saved_target ~= nil and multi then
  69.         target_unit(saved_target)
  70.     end
  71.     return true
  72.   end
  73.   if unit ~= false and target.debuff("Siphon Life").down then
  74.     if multi then
  75.         target_unit(unit.guid)
  76.     end
  77.     cast("Siphon Life", "target")
  78.     if saved_target ~= nil and multi then
  79.         target_unit(saved_target)
  80.     end
  81.     return true
  82.   end
  83.   return false
  84. end
  85. setfenv(spreadMyDots, dark_addon.environment.env)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement