Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. wOS.ForcePowers:RegisterNewPower({
  2. name = "Battle Meditate",
  3. icon = "BM",
  4. image = "wos/forceicons/meditate.png",
  5. description = "Channel your energy into others",
  6. think = function( self )
  7. if self.MeditateCooldown and self.MeditateCooldown >= CurTime() then return end
  8. if ( self.Owner:KeyDown( IN_ATTACK2 ) ) and !self:GetEnabled() and self.Owner:OnGround() then
  9. if !self._ForceMeditating then
  10. self.Owner.SaveAngles = self.Owner:GetAngles()
  11. self._ForceMeditating = true
  12. self._LastCharge = CurTime() + 5
  13. end
  14. else
  15. self._ForceMeditating = false
  16. end
  17. if self._ForceMeditating then
  18. self.Owner:SetNW2Bool("IsMeditating", true)
  19. if not self._LastCharge then self._LastCharge = CurTime() + 5 end
  20. if self._LastCharge < CurTime() then
  21. for _, ply in pairs( ents.FindInSphere( self.Owner:GetPos(), 200 ) ) do
  22. if not IsValid( ply ) then continue end
  23. if not ply:IsPlayer() then continue end
  24. if not ply:Alive() then continue end
  25. if ply == self.Owner then continue end
  26. ply.BattleMeditateBuff = CurTime() + 180
  27. ply:SetNW2Float( "BattlerTime", ply.BattleMeditateBuff )
  28. end
  29. self._LastCharge = CurTime() + 5
  30. end
  31. self.Owner:SetLocalVelocity(Vector(0, 0, 0))
  32. self.Owner:SetMoveType(MOVETYPE_NONE)
  33. self.Owner:SetSequenceOverride( "sit_zen", 1 )
  34. else
  35. self:SetMeditateMode( 0 )
  36. if self:GetMoveType() != MOVETYPE_WALK and self.Owner:GetNW2Float( "wOS.DevestatorTime", 0 ) < CurTime() then
  37. self.Owner:SetMoveType(MOVETYPE_WALK)
  38. end
  39. end
  40. if self.Owner:KeyReleased( IN_ATTACK2 ) then
  41. self.MeditateCooldown = CurTime() + 3
  42. end
  43. end
  44. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement