puppetize.lua 724 B

1234567891011121314151617181920212223
  1. local Puppetize = extend(Buff)
  2. Puppetize.tags = {}
  3. function Puppetize:activate()
  4. self.unit.channeling, self.unit.spawning, self.unit.casting = false, false, false
  5. self.unit.team = self.unit.team == 0 and ctx.player.team or 0
  6. self.unit.target = nil
  7. self.unit.animation:set('idle', {force = true})
  8. self.sound = ctx.sound:loop(data.media.sounds.vuju.puppetize)
  9. end
  10. function Puppetize:deactivate()
  11. self.unit.team = self.unit.team == 0 and ctx.player.team or 0
  12. self.unit.target = nil
  13. self.unit.animation:set('idle', {force = true})
  14. if self.owner then
  15. self.owner.channeling = false
  16. self.owner.animation:set('idle', {force = true})
  17. end
  18. if self.sound then self.sound:stop() end
  19. end
  20. return Puppetize