Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.83 KB | None | 0 0
  1.  
  2.  
  3. wOS.ForcePowers:RegisterNewPower({
  4. name = "Force Absorb",
  5. icon = "A",
  6. image = "wos/forceicons/absorb.png",
  7. cooldown = 0,
  8. description = "Hold Mouse 2 to protect yourself from harm",
  9. action = function( self )
  10. if ( self:GetForce() < 1 ) then return end
  11. self:SetEnabled(false)
  12. self:SetForce( self:GetForce() - 0.1 )
  13. self.Owner:SetNW2Float( "wOS.ForceAnim", CurTime() + 0.6 )
  14. self:SetNextAttack( 0.3 )
  15. return true
  16. end
  17. },
  18.  
  19. wOS.ForcePowers:RegisterNewPower({
  20. name = "Balance of the Force",
  21. icon = "BF",
  22. image = "",
  23. description = "Concentrate your Force to restore the energy. You won't be able to use skills for some time.",
  24. action = function( self )
  25. if ( self:GetForce() < 25 || !self.Owner:IsOnGround() ) then return end
  26. if self.Owner:GetNWFloat( "wOS.IsChanneling", 0 ) >= CurTime() then return end
  27. self:SetForce( self.MaxForce )
  28. self:SetNextAttack( 0.5 )
  29. self:PlayWeaponSound( "lightsaber/force_leap.wav" )
  30. self.Owner:SetNWFloat( "ForceBalance", CurTime() + 10 )
  31. self.Weapon:SetNextSecondaryFire( CurTime() + 5 )
  32. end
  33. },
  34. wOS.ForcePowers:RegisterNewPower({
  35. name = "Phasewalk",
  36. icon = "PW",
  37. image = "",
  38. cooldown = 10,
  39. description = "Lässt dich durch die Macht, den Weg verkürzen.",
  40. action = function(self)
  41. if (self:GetForce() < 20 ) then return end
  42.  
  43. self:SetForce(self:GetForce() - 20)
  44. self:SetNextAttack(0.5)
  45. local ply = self.Owner
  46. local pos = ply:GetShootPos()
  47. local ang = ply:GetAimVector()
  48.  
  49. local td = {}
  50. td.start = pos
  51. td.endpos = pos + (ang * 800)
  52. td.filter = ply
  53. local trace = util.TraceLine(td)
  54.  
  55.  
  56. self.Owner:SetPos(trace.HitPos - (ang * 10))
  57. self:SetNextAttack( 4 )
  58.  
  59. end
  60. },
  61. wOS.ForcePowers:RegisterNewPower({
  62. name = "Schatten-Angriff",
  63. icon = "SA",
  64. image = "",
  65. cooldown = 0,
  66. description = "Strike Up to 4 Enemys\n Cost: 80",
  67. action = function(self)
  68. if CLIENT then return end
  69. if self:GetForce() < 60 then return end
  70. local ent = self:SelectTargets( 1 )[1]
  71.  
  72. if (!IsValid(ent)) then return end
  73. if !ent:IsNPC() and !ent:IsPlayer() then return end
  74. --Setup damageinfo
  75. local dmg = DamageInfo()
  76. dmg:SetDamage( 75 )
  77. dmg:SetDamageType( DMG_DIRECT )
  78. dmg:SetInflictor( self.Owner )
  79. dmg:SetAttacker( self.Owner )
  80. self:SetForce( self:GetForce() - 60 )
  81.  
  82. local Hit = {[ent:EntIndex()] = ent}
  83. local count = 0
  84. for x = 1,4 do
  85. local org = ent:GetPos()
  86. local sound = CreateSound( ent, Sound( self.SwingSound ) )
  87. ent:TakeDamageInfo( dmg )
  88. sound:Play()
  89. timer.Simple(0.75, function()
  90. sound:Stop()
  91. end)
  92. //sound:ChangeVolume( 0, 0 )
  93. // ent = nil
  94.  
  95. for x,y in pairs(ents.FindInSphere(org, 512) ) do
  96. if (y:IsPlayer() or y:IsNPC()) and y != self.Owner and !Hit[y:EntIndex()] then
  97. Hit[y:EntIndex()] = y
  98. ent = y
  99. end
  100. end
  101.  
  102. ent = ent or table.Random(Hit)
  103. if x == 4 then
  104. pos1 = self.Owner:GetPos()
  105. pos2 = ent:GetPos()
  106. self.Owner:SetPos(pos2)
  107. ent:SetPos(pos1)
  108. self:SetNextAttack( 2 )
  109. end
  110. end
  111.  
  112. end
  113. },
  114. wOS.ForcePowers:RegisterNewPower({
  115. name = "Ground Slam",
  116. icon = "GS",
  117. image = "",
  118. cooldown = 120,
  119. description = "Strike Up to 4 Enemys\n Cost: 80",
  120. action = function( self )
  121. if ( self:GetForce() < 120 || CLIENT || !self.Owner:IsOnGround() ) then return end
  122. local elev = 400
  123. local time = 60
  124. ent = self.Owner
  125.  
  126. self:SetForce(self:GetForce() - 120)
  127. self:SetNextAttack( 120 )
  128.  
  129.  
  130. for j = 0,6 do
  131. for i = 0, 24 do
  132. local ed = EffectData()
  133. ed:SetOrigin( self.Owner:GetPos() + Vector(0,0,0) )
  134. ed:SetStart( self.Owner:GetPos() + Vector(0,0,0) + Angle(0 , i * 15, 0):Forward() * 512)
  135. util.Effect( "force_groundslam", ed, true, true )
  136. end
  137. end
  138.  
  139. local maxdist = 90 * 4
  140.  
  141. local ed = EffectData()
  142. ed:SetOrigin( self.Owner:GetPos() + Vector( 0, 0, 36 ) )
  143. ed:SetRadius( maxdist )
  144. util.Effect( "rb655_force_repulse_out", ed, true, true )
  145. for i, e in pairs( ents.FindInSphere( self.Owner:GetPos(), maxdist ) ) do
  146. if (e.Team and e:Team() == self.Owner:Team()) or (e.PlayerTeam and e.PlayerTeam == self.Owner:Team()) then continue end
  147.  
  148. local dist = self.Owner:GetPos():Distance( e:GetPos() )
  149. local mul = ( maxdist - dist ) / 256
  150.  
  151. local v = ( self.Owner:GetPos() - e:GetPos() ):GetNormalized()
  152. v.z = 0
  153.  
  154. local dmg = DamageInfo()
  155. dmg:SetDamagePosition( e:GetPos() + e:OBBCenter() )
  156. dmg:SetDamage( 3000 * mul )
  157. dmg:SetDamageType( DMG_DISSOLVE )
  158. dmg:SetDamageForce( -v * math.min( mul * 40000, 80000 ) )
  159. dmg:SetInflictor( self.Owner )
  160. dmg:SetAttacker( self.Owner )
  161. e:TakeDamageInfo( dmg )
  162.  
  163. if ( e:IsOnGround() ) then
  164. e:SetVelocity( v * mul * -2048 + Vector( 0, 0, 64 ) )
  165. elseif ( !e:IsOnGround() ) then
  166. e:SetVelocity( v * mul * -1024 + Vector( 0, 0, 64 ) )
  167. end
  168. end
  169.  
  170. if ( !self.SoundLightning ) then
  171. self.SoundLightning = CreateSound( self.Owner, "lightsaber/force_lightning" .. math.random( 1, 2 ) .. ".wav" )
  172. self.SoundLightning:Play()
  173. self.SoundLightning:ChangeVolume(0,0.3)
  174. else
  175. self.SoundLightning:Play()
  176. end
  177. timer.Create( "test", 0.6, 1, function() if ( self.SoundLightning ) then self.SoundLightning:Stop() self.SoundLightning = nil end end )
  178.  
  179. self:PlayWeaponSound( "lightsaber/force_repulse.wav" )
  180. end
  181. },
  182.  
  183. wOS.ForcePowers:RegisterNewPower({
  184. name = "Force Levitate",
  185. icon = "FL",
  186. image = "",
  187. target = 1,
  188. cooldown = 0,
  189. description = "Use the Force to lift yourself up.",
  190. action = function( self )
  191. if ( self:GetForce() < 10 ) then return end
  192. self:SetForce( self:GetForce() - 0.5 )
  193. self.Weapon:SetNextSecondaryFire( CurTime() + 0.1 )
  194. self.Owner:SetVelocity( Vector( 0, 0, 70) )
  195. end
  196. },
  197.  
  198. wOS.ForcePowers:RegisterNewPower({
  199. name = "Force Aura Heal",
  200. icon = "AH",
  201. image = "wos/forceicons/heal.png",
  202. cooldown = 0,
  203. description = "Hold Mouse 2 to slowly heal you",
  204. action = function( self )
  205. local pl = self.Owner;
  206. if pl:Health() >= pl:GetMaxHealth() then pl:Health(pl:GetMaxHealth()) return end
  207. self.Owner:SetHealth( self.Owner:Health() + (pl:GetMaxHealth() / 100) )
  208. local ed = EffectData()
  209. ed:SetOrigin( self.Owner:GetPos() )
  210. util.Effect( "rb655_force_heal", ed, true, true )
  211. self:SetNextAttack( 0.2 )
  212. end
  213. },
  214.  
  215. wOS.ForcePowers:RegisterNewPower({
  216. name = "Force Lightning",
  217. icon = "L",
  218. target = 1,
  219. image = "wos/forceicons/lightning.png",
  220. cooldown = 0,
  221. manualaim = false,
  222. description = "Torture people ( and monsters ) at will.",
  223. action = function( self )
  224. if ( self:GetForce() < 1 ) then return end
  225.  
  226. local foundents = 0
  227. for id, ent in pairs( self:SelectTargets( 1 ) ) do
  228. if ( !IsValid( ent ) ) then continue end
  229.  
  230. foundents = foundents + 1
  231. local ed = EffectData()
  232. ed:SetOrigin( self:GetSaberPosAng() )
  233. ed:SetEntity( ent )
  234. util.Effect( "rb655_force_lighting_jedi", ed, true, true )
  235.  
  236. local dmg = DamageInfo()
  237. dmg:SetAttacker( self.Owner || self )
  238. dmg:SetInflictor( self.Owner || self )
  239. dmg:SetDamage( 4 )
  240. if ( ent:IsNPC() ) then dmg:SetDamage( 1.6 ) end
  241. ent:TakeDamageInfo( dmg )
  242.  
  243. end
  244.  
  245. if ( foundents > 0 ) then
  246. self:SetForce( self:GetForce() - foundents )
  247. if ( !self.SoundLightning ) then
  248. self.SoundLightning = CreateSound( self.Owner, "lightsaber/force_lightning" .. math.random( 1, 2 ) .. ".wav" )
  249. self.SoundLightning:Play()
  250. else
  251. self.SoundLightning:Play()
  252. end
  253.  
  254. timer.Create( "test", 0.2, 1, function() if ( self.SoundLightning ) then self.SoundLightning:Stop() self.SoundLightning = nil end end )
  255. end
  256. self:SetNextAttack( 0.1 )
  257. return true
  258. end
  259.  
  260. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement