Advertisement
MVGDaniel

Untitled

May 6th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. wOS.ForcePowers:RegisterNewPower({
  2. name = "Channel Hatred",
  3. icon = "HT",
  4. image = "wos/forceicons/channel_hatred.png",
  5. description = "I can feel your anger",
  6. think = function( self )
  7. if self.ChannelCooldown and self.ChannelCooldown >= CurTime() then return end
  8. if ( self.Owner:KeyDown( IN_ATTACK2 ) ) and !self:GetEnabled() and self.Owner:OnGround() then
  9. self._ForceChanneling = true
  10. else
  11. self._ForceChanneling = false
  12. end
  13. if self.Owner:KeyReleased( IN_ATTACK2 ) then
  14. self.ChannelCooldown = CurTime() + 12
  15. end
  16. if self._ForceChanneling then
  17. if not self._NextChannelHeal then self._NextChannelHeal = 0 end
  18. self.Owner:SetNW2Bool("wOS.IsChanneling", true)
  19. if self._NextChannelHeal < CurTime() then
  20. self.Owner:SetHealth( math.min( self.Owner:Health() + ( self.Owner:GetMaxHealth()*0.01 ), self.Owner:GetMaxHealth() ) )
  21. if #self.DevestatorList > 0 then
  22. self:SetDevEnergy( self:GetDevEnergy() + self.DevCharge + 15 )
  23. end
  24. local tbl = wOS.ExperienceTable[ self.Owner:GetUserGroup() ]
  25. if not tbl then
  26. tbl = wOS.ExperienceTable[ "Default" ].Meditation
  27. else
  28. tbl = wOS.ExperienceTable[ self.Owner:GetUserGroup() ].Meditation
  29. end
  30. self.Owner:AddSkillXP( tbl )
  31. self._NextChannelHeal = CurTime() + 3
  32. end
  33. self.Owner:SetLocalVelocity(Vector(0, 0, 0))
  34. self.Owner:SetMoveType(MOVETYPE_NONE)
  35. if ( !self.SoundChanneling ) then
  36. self.SoundChanneling = CreateSound( self.Owner, "ambient/levels/citadel/field_loop1.wav" )
  37. self.SoundChanneling:Play()
  38. else
  39. self.SoundChanneling:Play()
  40. end
  41.  
  42. timer.Create( "test", 0.2, 1, function() if ( self.SoundChanneling ) then self.SoundChanneling:Stop() self.SoundChanneling = nil end end )
  43. else
  44. self.Owner:SetNW2Bool("wOS.IsChanneling", false)
  45. if self:GetMoveType() != MOVETYPE_WALK and self.Owner:GetNW2Float( "wOS.DevestatorTime", 0 ) < CurTime() then
  46. self.Owner:SetMoveType(MOVETYPE_WALK)
  47. end
  48. end
  49. if self.Owner:KeyReleased( IN_ATTACK2 ) then
  50. self.ChannelCooldown = CurTime() + 8
  51. end
  52. end
  53. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement