Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wOS.ForcePowers:RegisterNewPower({
- name = "Battle Meditate",
- icon = "BM",
- image = "wos/forceicons/meditate.png",
- description = "Channel your energy into others",
- think = function( self )
- if self.MeditateCooldown and self.MeditateCooldown >= CurTime() then return end
- if ( self.Owner:KeyDown( IN_ATTACK2 ) ) and !self:GetEnabled() and self.Owner:OnGround() then
- if !self._ForceMeditating then
- self.Owner.SaveAngles = self.Owner:GetAngles()
- self._ForceMeditating = true
- self._LastCharge = CurTime() + 5
- end
- else
- self._ForceMeditating = false
- end
- if self._ForceMeditating then
- self.Owner:SetNW2Bool("IsMeditating", true)
- if not self._LastCharge then self._LastCharge = CurTime() + 5 end
- if self._LastCharge < CurTime() then
- for _, ply in pairs( ents.FindInSphere( self.Owner:GetPos(), 200 ) ) do
- if not IsValid( ply ) then continue end
- if not ply:IsPlayer() then continue end
- if not ply:Alive() then continue end
- if ply == self.Owner then continue end
- ply.BattleMeditateBuff = CurTime() + 180
- ply:SetNW2Float( "BattlerTime", ply.BattleMeditateBuff )
- end
- self._LastCharge = CurTime() + 5
- end
- self.Owner:SetLocalVelocity(Vector(0, 0, 0))
- self.Owner:SetMoveType(MOVETYPE_NONE)
- self.Owner:SetSequenceOverride( "sit_zen", 1 )
- else
- self:SetMeditateMode( 0 )
- if self:GetMoveType() != MOVETYPE_WALK and self.Owner:GetNW2Float( "wOS.DevestatorTime", 0 ) < CurTime() then
- self.Owner:SetMoveType(MOVETYPE_WALK)
- end
- end
- if self.Owner:KeyReleased( IN_ATTACK2 ) then
- self.MeditateCooldown = CurTime() + 3
- end
- end
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement