Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wOS.ForcePowers:RegisterNewPower({
- name = "Channel Hatred",
- icon = "HT",
- image = "wos/forceicons/channel_hatred.png",
- description = "I can feel your anger",
- think = function( self )
- if self.ChannelCooldown and self.ChannelCooldown >= CurTime() then return end
- if ( self.Owner:KeyDown( IN_ATTACK2 ) ) and !self:GetEnabled() and self.Owner:OnGround() then
- self._ForceChanneling = true
- else
- self._ForceChanneling = false
- end
- if self.Owner:KeyReleased( IN_ATTACK2 ) then
- self.ChannelCooldown = CurTime() + 3
- end
- if self._ForceChanneling then
- if not self._NextChannelHeal then self._NextChannelHeal = 0 end
- self:SetMeditateMode( 2 )
- if self._NextChannelHeal < CurTime() then
- self.Owner:SetHealth( math.min( self.Owner:Health() + ( self.Owner:GetMaxHealth()*0.05 ), 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._NextChannelHeal = CurTime() + 3
- 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.ChannelCooldown = CurTime() + 3
- end
- end
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement