Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. name = "Ground Slam",
  2. icon = "GS",
  3. texture = "star/icon/ground_slam.png",
  4. description = "Shocks and destroys everything around you.",
  5. action = function( self )
  6. if ( self:GetForce() < 60 || CLIENT || !self.Owner:IsOnGround() ) then return end
  7. local elev = 400
  8. local time = 1
  9. ent = self.Owner
  10.  
  11. self:SetForce(self:GetForce() - 60)
  12. self:SetNextAttack( 1 )
  13.  
  14.  
  15. for j = 0,6 do
  16. for i = 0, 24 do
  17. local ed = EffectData()
  18. ed:SetOrigin( self.Owner:GetPos() + Vector(0,0,0) )
  19. ed:SetStart( self.Owner:GetPos() + Vector(0,0,0) + Angle(0 , i * 15, 0):Forward() * 512)
  20. util.Effect( "force_groundslam", ed, true, true )
  21. end
  22. end
  23.  
  24. local maxdist = 128 * 4
  25.  
  26. local ed = EffectData()
  27. ed:SetOrigin( self.Owner:GetPos() + Vector( 0, 0, 36 ) )
  28. ed:SetRadius( maxdist )
  29. util.Effect( "rb655_force_repulse_out", ed, true, true )
  30. for i, e in pairs( ents.FindInSphere( self.Owner:GetPos(), maxdist ) ) do
  31. if (e.Team and e:Team() == self.Owner:Team()) or (e.PlayerTeam and e.PlayerTeam == self.Owner:Team()) then continue end
  32.  
  33. local dist = self.Owner:GetPos():Distance( e:GetPos() )
  34. local mul = ( maxdist - dist ) / 256
  35.  
  36. local v = ( self.Owner:GetPos() - e:GetPos() ):GetNormalized()
  37. v.z = 0
  38.  
  39. local dmg = DamageInfo()
  40. dmg:SetDamagePosition( e:GetPos() + e:OBBCenter() )
  41. dmg:SetDamage( 700 * mul )
  42. dmg:SetDamageType( DMG_DISSOLVE )
  43. dmg:SetDamageForce( -v * math.min( mul * 40000, 80000 ) )
  44. dmg:SetInflictor( self.Owner )
  45. dmg:SetAttacker( self.Owner )
  46. e:TakeDamageInfo( dmg )
  47.  
  48. if ( e:IsOnGround() ) then
  49. e:SetVelocity( v * mul * -2048 + Vector( 0, 0, 64 ) )
  50. elseif ( !e:IsOnGround() ) then
  51. e:SetVelocity( v * mul * -1024 + Vector( 0, 0, 64 ) )
  52. end
  53. end
  54.  
  55. if ( !self.SoundLightning ) then
  56. self.SoundLightning = CreateSound( self.Owner, "lightsaber/force_lightning" .. math.random( 1, 2 ) .. ".wav" )
  57. self.SoundLightning:Play()
  58. self.SoundLightning:ChangeVolume(0,0.3)
  59. else
  60. self.SoundLightning:Play()
  61. end
  62. timer.Create( "test", 0.6, 1, function() if ( self.SoundLightning ) then self.SoundLightning:Stop() self.SoundLightning = nil end end )
  63.  
  64. self:PlayWeaponSound( "lightsaber/force_repulse.wav" )
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement