warpdragon

Tank Quake

Nov 26th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. tank_earthquake = class({})
  2.  
  3. --------------------------------------------------------------------------------
  4. function tank_earthquake:OnAbilityPhaseStart()
  5. self:GetCaster():RemoveGesture( ACT_DOTA_CAST_ABILITY_2 )
  6. self:GetCaster():StartGestureWithPlaybackRate( ACT_DOTA_CAST_ABILITY_2, 2.25/self:GetCastPoint())
  7. self.position = self:GetCursorPosition()
  8. self.radius = self:GetSpecialValueFor("stun_radius")
  9. self.warningFX = ParticleManager:CreateParticle("particles/econ/generic/generic_aoe_shockwave_1/generic_aoe_shockwave_1.vpcf", PATTACH_WORLDORIGIN, nil)
  10. ParticleManager:SetParticleControl(self.warningFX, 0, self.position)
  11. ParticleManager:SetParticleControl(self.warningFX, 2, Vector(self:GetCastPoint()*3,0,1))
  12. ParticleManager:SetParticleControl(self.warningFX, 1, Vector(self.radius,0,0))
  13. ParticleManager:SetParticleControl(self.warningFX, 3, Vector(255,0,0))
  14. ParticleManager:SetParticleControl(self.warningFX, 4, Vector(0,0,0))
  15. return true
  16. end
  17.  
  18. function tank_earthquake:OnAbilityPhaseInterrupted()
  19. self:GetCaster():RemoveGesture( ACT_DOTA_CAST_ABILITY_2 )
  20. ParticleManager:ReleaseParticleIndex( self.warningFX )
  21. end
  22.  
  23.  
  24. function tank_earthquake:OnSpellStart()
  25. local caster = self:GetCaster()
  26.  
  27. caster:Interrupt()
  28. caster:Stop()
  29. local duration = self:GetSpecialValueFor("stun_duration")
  30. local damage = self:GetSpecialValueFor("damage")
  31.  
  32. local targets = FindUnitsInRadius( caster:GetTeamNumber(), self.position, caster, self.radius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, 0, 0, false )
  33. ParticleManager:ReleaseParticleIndex( self.warningFX )
  34. for _, target in pairs( targets ) do
  35. target:AddNewModifier(target, self, "modifier_stunned", {duration = duration})
  36. ApplyDamage({
  37. victim = target,
  38. attacker = self:GetCaster(),
  39. damage = damage,
  40. ability = self,
  41. damage_type = self:GetAbilityDamageType()
  42. })
  43. end
  44.  
  45. stunFX = ParticleManager:CreateParticle("particles/units/heroes/hero_leshrac/leshrac_split_earth.vpcf", PATTACH_WORLDORIGIN, nil)
  46. ParticleManager:SetParticleControl(stunFX, 0, self.position)
  47. ParticleManager:SetParticleControl(stunFX, 2, self.position)
  48. ParticleManager:SetParticleControl(stunFX, 1, Vector(self.radius,0,0))
  49. ParticleManager:ReleaseParticleIndex( stunFX )
  50. EmitSoundOnLocationWithCaster(self.position, "n_creep_Ursa.Clap", caster)
  51.  
  52. end
Advertisement
Add Comment
Please, Sign In to add comment