Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wOS.ForcePowers:RegisterNewPower({
- name = "Meditate",
- icon = "M",
- image = "wos/forceicons/meditate.png",
- description = "Relax yourself and channel your energy",
- 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
- self._ForceMeditating = true
- else
- self._ForceMeditating = false
- end
- if self._ForceMeditating then
- self:SetMeditateMode( 1 )
- if not self._NextMeditateHeal then self._NextMeditateHeal = 0 end
- if self._NextMeditateHeal < CurTime() then
- self.Owner:SetHealth( math.min( self.Owner:Health() + ( self.Owner:GetMaxHealth()*0.25 ), self.Owner:GetMaxHealth() ) )
- if #self.DevestatorList > 0 then
- self:SetDevEnergy( self:GetDevEnergy() + self.DevCharge )
- end
- local tbl = wOS.ALCS.Config.Skills.ExperienceTable[ self.Owner:GetUserGroup() ]
- if not tbl then
- tbl = wOS.ALCS.Config.Skills.ExperienceTable[ "Default" ].Meditation
- else
- tbl = wOS.ALCS.Config.Skills.ExperienceTable[ self.Owner:GetUserGroup() ].Meditation
- end
- self.Owner:AddSkillXP( tbl )
- self._NextMeditateHeal = CurTime() + 1
- end
- self.Owner:SetLocalVelocity(Vector(0, 0, 0))
- self.Owner:SetMoveType(MOVETYPE_NONE)
- 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() + 2
- end
- end
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement