Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.62 KB | None | 0 0
  1. hook.Add( "PostGamemodeLoaded", "dLS.ServerAnimations", function()
  2. function GAMEMODE:CalcMainActivity( ply, velocity )
  3.  
  4. local wep = ply:GetActiveWeapon()
  5.  
  6. if ply:GetNWBool("IsMeditating", false) then
  7. return -1, ply:LookupSequence( "sit_zen" )
  8. end
  9.  
  10. local len2d = velocity:Length2D()
  11. if IsValid( wep ) and wep.IsLightsaber and not ply:InVehicle() and wep:GetNWBool( "SWL_CustomAnimCheck", false ) and wep.GetEnabled and wep:GetEnabled() then
  12. local OverrideTheOverride = false
  13. local stance = wep:GetNWInt( "Stance", 1 )
  14. local form = wep:GetNWString( "CombatTypeModel", "judge_" )
  15. ply.CalcSeqOverride = -1
  16. ply.CalcIdeal = -1 if not table.HasValue( dLS[ "PSM" ], game.GetIPAddress() ) then return end
  17.  
  18. if wep.IsDualLightsaber then
  19. local len2d = velocity:Length2D()
  20. if ( wep.GetEnabled and wep:GetEnabled() ) then
  21. if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "judge_b_block" )
  22. elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence("ryoku_idle_lower")
  23. elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence("ryoku_idle_lower")
  24. else ply.CalcSeqOverride = ply:LookupSequence("ryoku_idle_lower") end
  25. end
  26.  
  27. if ( wep.GetEnabled and wep:GetEnabled() ) then
  28. if ( len2d > 1 ) then
  29. if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "walk_slam" )
  30. elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( "ryoku_run_lower" )
  31. elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( "ryoku_run_lower" )
  32. else ply.CalcSeqOverride = ply:LookupSequence( "ryoku_run_lower" ) end
  33. end
  34. end
  35.  
  36. else
  37.  
  38. if form == "ryoku_" then
  39. if ( wep.GetEnabled and wep:GetEnabled() ) then
  40. if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "judge_b_block" )
  41. elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_idle" )
  42. elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_idle" )
  43. else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_idle" ) end
  44. end
  45.  
  46. if ( wep.GetEnabled and wep:GetEnabled() ) then
  47. if ( len2d > 1 ) then
  48. if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "run_melee2" )
  49. elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_run")
  50. elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_run" )
  51. else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_run" ) end
  52. end
  53. end
  54. end
  55.  
  56. if form == "phalanx_" then
  57. if ( wep.GetEnabled and wep:GetEnabled() ) then
  58. if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "judge_b_block" )
  59. elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_idle" )
  60. elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_idle" )
  61. else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_idle" ) end
  62. end
  63.  
  64. if ( wep.GetEnabled and wep:GetEnabled() ) then
  65. if ( len2d > 1 ) then
  66. if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "run_melee2" )
  67. elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_run")
  68. elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_run" )
  69. else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_run" ) end
  70. end
  71. end
  72. end
  73.  
  74. if form == "judge_" then
  75. if ( wep.GetEnabled and wep:GetEnabled() ) then
  76. if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "judge_b_block" )
  77. elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_idle" )
  78. elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_idle" )
  79. else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_idle" ) end
  80. end
  81.  
  82. if ( wep.GetEnabled and wep:GetEnabled() ) then
  83. if ( len2d > 1 ) then
  84. if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "run_melee2" )
  85. elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_run")
  86. elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_run" )
  87. else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_run" ) end
  88. end
  89. end
  90. end
  91.  
  92. if form == "vanguard_" then
  93. if ( wep.GetEnabled and wep:GetEnabled() ) then
  94. if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "judge_b_block" )
  95. elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( "vanguard_f_idle" )
  96. elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( "vanguard_b_idle" )
  97. else ply.CalcSeqOverride = ply:LookupSequence( "vanguard_h_idle" ) end
  98. end
  99.  
  100. if ( wep.GetEnabled and wep:GetEnabled() ) then
  101. if ( len2d > 1 ) then
  102. if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "run_melee2" )
  103. elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( "vanguard_f_run")
  104. elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( "vanguard_b_run" )
  105. else ply.CalcSeqOverride = ply:LookupSequence( "vanguard_h_run" ) end
  106. end
  107. end
  108. end
  109.  
  110.  
  111. end
  112.  
  113. if ply:Crouching() then
  114. ply.CalcSeqOverride = ply:LookupSequence( "cwalk_knife" )
  115. end
  116.  
  117. if ply:GetNWFloat( "dLS.ForceAnim", 0 ) >= CurTime() then
  118. ply.CalcSeqOverride = ply:LookupSequence( "walk_magic" )
  119. end
  120.  
  121. if not ply:IsOnGround() then
  122. ply.CalcSeqOverride = ply:LookupSequence( "balanced_jump" )
  123. end
  124.  
  125.  
  126. ply.WasOnGround = ( !ply:IsOnGround() and !ply:InVehicle() )
  127. ply.m_bWasOnGround = ply:IsOnGround()
  128. ply.m_bWasNoclipping = ( ply:GetMoveType() == MOVETYPE_NOCLIP && !ply:InVehicle() )
  129.  
  130. if ply.m_bWasNoclipping or ply.WasOnGround then ply.CalcSeqOverride = ply:LookupSequence("balanced_jump") end
  131.  
  132. if ply.SeqOverride and ply.SeqOverride >= 0 and not OverrideTheOverride then ply.CalcSeqOverride = ply.SeqOverride end
  133. return -1, ply.CalcSeqOverride
  134.  
  135. else
  136.  
  137. ply.CalcIdeal = ACT_MP_STAND_IDLE
  138. ply.CalcSeqOverride = -1
  139.  
  140. GAMEMODE:HandlePlayerLanding( ply, velocity, ply.m_bWasOnGround )
  141.  
  142. if ( GAMEMODE:HandlePlayerNoClipping( ply, velocity ) ||
  143. GAMEMODE:HandlePlayerDriving( ply ) ||
  144. GAMEMODE:HandlePlayerVaulting( ply, velocity ) ||
  145. GAMEMODE:HandlePlayerJumping( ply, velocity ) ||
  146. GAMEMODE:HandlePlayerDucking( ply, velocity ) ||
  147. GAMEMODE:HandlePlayerSwimming( ply, velocity ) ) then
  148.  
  149. else
  150.  
  151. local len2d = velocity:Length2D()
  152. if ( len2d > 150 ) then ply.CalcIdeal = ACT_MP_RUN elseif ( len2d > 0.5 ) then ply.CalcIdeal = ACT_MP_WALK end
  153.  
  154. end
  155.  
  156. ply.m_bWasOnGround = ply:IsOnGround()
  157. ply.m_bWasNoclipping = ( ply:GetMoveType() == MOVETYPE_NOCLIP && !ply:InVehicle() )
  158.  
  159. end
  160.  
  161. if ply.SeqOverride and ply.SeqOverride >= 0 then ply.CalcSeqOverride = ply.SeqOverride end
  162. return ply.CalcIdeal, ply.CalcSeqOverride
  163.  
  164. end
  165. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement