twinblades.lua 490 B

1234567891011121314151617181920
  1. local TwinBlades = extend(Buff)
  2. TwinBlades.tags = {}
  3. function TwinBlades:activate()
  4. self.dirtyTimer = 0
  5. end
  6. function TwinBlades:update()
  7. self.dirtyTimer = timer.rot(self.dirtyTimer)
  8. end
  9. function TwinBlades:preattack(target, amount)
  10. local secondTarget, distance = ctx.target:closest(target, 'ally', 'unit')
  11. if secondTarget and distance < 50 and self.dirtyTimer == 0 then
  12. self.dirtyTimer = ls.tickrate
  13. self.unit:attack({target = secondTarget})
  14. end
  15. end
  16. return TwinBlades