LaoArchAngel

NeP Interrupt Certain Spells

Dec 30th, 2016
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. -- This would be somewhere in a FakeUnits file.  It could go in your rotation file, but that could get ugly
  2. local spellsToInterrupt = {
  3.     2060, -- Heal
  4.     21162, -- Fireball
  5.     -- And so on
  6. }
  7.  
  8. local function isCastingInterruptable(unit, distance)
  9.     local actualDist = NeP.DSL:Get("distance")(unit)
  10.     local inFront = NeP.DSL:Get("infront")(unit)
  11.  
  12.     if actualDist > distance or not inFront then return false
  13.  
  14.     for intSpell in spellsToInterrupt do
  15.         if NeP.DSL:Get("casting")(unit, intSpell) then return true end
  16.     end
  17. end
  18.  
  19. NeP.FakeUnits:Add('toInterrupt', function(distance)
  20.     for _, Obj in pairs(NeP.OM:Get(Enemy)) do
  21.         if isCastingInterruptable(Obj.key, distance) then
  22.             return Obj.key
  23.         end
  24.     end
  25.  
  26.     return nil
  27.  end)
  28.  
  29. -- This is the line in your rotation
  30.  {Interrupts, 'toInterrupt(5) & toInterrupt(5).interruptAt(50) & toggle(interrupts)', 'toInterrupt(5)'}
Advertisement
Add Comment
Please, Sign In to add comment