Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 77.66 KB | None | 0 0
  1. /*
  2. To Do
  3. - Better Sounds
  4. */
  5.  
  6. -- Heyo, welcome to this lua file
  7. -- if you're using this to learn, feel free to snoop around and ask buu342@hotmail.com or buu342 on steam for help
  8. -- If you're using this to steal, be nice to me :(
  9. -- If you're using this as the code for your world destruction machine, make sure Portugal isn't destroyed. I like it there
  10. -- If your reason hasn't been stated above, sorry I ignored you D:
  11. -- Whatever it is, have fun looking around
  12. -- Note to self: Stop writing as if someone is going to read this. No one really cares
  13. -- But if you're this far, then you do. Love you <33
  14.  
  15. if (SERVER) then
  16. AddCSLuaFile("weapon_ds_base.lua")
  17. end
  18.  
  19. -- Swooshy and Pachingy sounds
  20.  
  21. local soundData = {
  22. name = "Weapon_CBroad.Draw" ,
  23. channel = CHAN_ITEM,
  24. volume = 0.5,
  25. soundlevel = 80,
  26. pitchstart = 100,
  27. pitchend = 100,
  28. sound = "weapons/DarkSouls/Sheath.wav"
  29. }
  30. sound.Add(soundData)
  31.  
  32. local soundData = {
  33. name = "Weapon_CBroad.Holster" ,
  34. channel = CHAN_ITEM,
  35. volume = 0.5,
  36. soundlevel = 80,
  37. pitchstart = 100,
  38. pitchend = 100,
  39. sound = "weapons/DarkSouls/Holster.wav"
  40. }
  41. sound.Add(soundData)
  42.  
  43. local soundData = {
  44. name = "Weapon_CBroad.Parry" ,
  45. channel = CHAN_ITEM,
  46. volume = 0.5,
  47. soundlevel = 80,
  48. pitchstart = 100,
  49. pitchend = 100,
  50. sound = "weapons/DarkSouls/Parry.wav"
  51. }
  52. sound.Add(soundData)
  53.  
  54. -- Precaching stuff
  55. util.PrecacheModel("models/weapons/c_ds_SSAS.mdl")
  56. util.PrecacheModel("models/weapons/w_ds_shieldhitbox.mdl")
  57. util.PrecacheSound("weapons/DarkSouls/block.wav")
  58. util.PrecacheSound("weapons/DarkSouls/Holster.wav")
  59. util.PrecacheSound("weapons/DarkSouls/Parry.wav")
  60. util.PrecacheSound("weapons/DarkSouls/Parry_Sucess.wav")
  61. util.PrecacheSound("weapons/DarkSouls/Sheath.wav")
  62. util.PrecacheSound("weapons/DarkSouls/Swing_HitFlesh.wav")
  63. util.PrecacheSound("weapons/DarkSouls/Swing_HitPowerful.wav")
  64. util.PrecacheSound("weapons/DarkSouls/Swing_HitStuff.wav")
  65. util.PrecacheSound("weapons/DarkSouls/Swing_HitWorld.wav")
  66. util.PrecacheSound("weapons/DarkSouls/Swing1.wav")
  67. util.PrecacheSound("weapons/DarkSouls/Swing2.wav")
  68. util.PrecacheSound("weapons/DarkSouls/Swing3.wav")
  69.  
  70. -- Screen stuff
  71.  
  72. if (CLIENT) then
  73. SWEP.DrawAmmo = false
  74. SWEP.DrawCrosshair = false
  75. SWEP.ViewModelFOV = 50
  76. end
  77.  
  78. SWEP.Base = "weapon_base"
  79.  
  80. if CLIENT then
  81. SWEP.PrintName = "Broadsword"
  82. SWEP.Author = "Buu342"
  83. SWEP.Slot = 0
  84. SWEP.SlotPos = 0
  85. SWEP.IconLetter = "j"
  86. SWEP.Icon = surface.GetTextureID("VGUI/entities/weapon_ds_broadsword")
  87. SWEP.KillIcon = "VGUI/entities/weapon_ds_broadsword"
  88. killicon.Add("weapon_ds_broadsword",SWEP.KillIcon,Color(255,255,255))
  89. SWEP.WepSelectIcon = SWEP.Icon
  90. end
  91.  
  92. -- Your normal SWEP content.
  93.  
  94. SWEP.Category = "Dark Souls"
  95.  
  96. SWEP.ViewModelFlip = false
  97. SWEP.HoldType = "duel"
  98. SWEP.UseHands = true
  99.  
  100. SWEP.BobScale = 1
  101.  
  102. SWEP.ViewModel = "models/weapons/c_ds_SSAS.mdl"
  103. SWEP.WorldModel = "models/weapons/w_bs_broadsword.mdl"
  104.  
  105. SWEP.Spawnable = false -- Let's NOT spawn the base, because otherwise some things won't work (such as parrying)
  106. SWEP.AdminSpawnable = true
  107.  
  108. SWEP.Primary.Sound1 = "weapons/DarkSouls/Swing1.wav"
  109. SWEP.Primary.Sound2 = "weapons/DarkSouls/Swing2.wav"
  110. SWEP.Primary.Sound3 = "weapons/DarkSouls/Swing3.wav"
  111.  
  112. SWEP.Primary.Damage = 10
  113.  
  114. SWEP.Primary.ClipSize = -1
  115. SWEP.Primary.DefaultClip = 1
  116. SWEP.Primary.Automatic = false
  117. SWEP.Primary.Ammo = "none"
  118.  
  119. SWEP.Secondary.ClipSize = -1
  120. SWEP.Secondary.DefaultClip = -1
  121. SWEP.Secondary.Automatic = false
  122. SWEP.Secondary.Ammo = "none"
  123.  
  124. -- New Variables
  125.  
  126. SWEP.ModelGroup = 0 --Which bodygroup to use for the sword? (This is to keep download speed and file amount to a minimum)
  127. SWEP.ShieldGroup = 0 --Don't Touch this. It's related to the shield model.
  128. SWEP.SwingSpeed = 1 --How quickly the animations play in percentage. 1 = normal; 0.5 = half speed; 2 = double speed; etc...
  129. SWEP.CrouchPos = Vector(-1,-1,.5) --Makes viewmodel move back when crouching for """""Immersion"""""
  130. SWEP.Reach = 95
  131.  
  132. -- Set up variables for prediction
  133. function SWEP:SetupDataTables()
  134. self:NetworkVar("Int",0,"Sword_AttackType") --Handles swinging animation
  135. self:NetworkVar("Int",1,"Shield_Model") --Handles shield model
  136. self:NetworkVar("Float",0,"Sword_FakeTimer1") --Sets CanAttack to true for followup attack
  137. self:NetworkVar("Float",1,"Sword_FakeTimer2") --Sets CanAttack to false after failing followup attack
  138. self:NetworkVar("Float",2,"Sword_FakeTimer3") --Sets CanAttack to true after failing followup attack and waiting for the animation to end
  139. self:NetworkVar("Float",3,"Sword_FakeTimer4") --Handles Idle Animation On Deploy and other stuff
  140. self:NetworkVar("Float",4,"Sword_AttackingTimer") --Handles sounds and ability to get parried
  141. self:NetworkVar("Float",5,"Shield_FakeTimer1") --Handles Blocking Animation in
  142. self:NetworkVar("Float",6,"Shield_FakeTimer2") --Handles Blocking Animation out
  143. self:NetworkVar("Float",7,"Shield_FakeTimer3") --Handles Parrying
  144. self:NetworkVar("Float",8,"Sword_Stunned") --Handles Stunning
  145. self:NetworkVar("Float",9,"FakeTimerShoot") --Handles the time between the player clicking and the "bullet" firing
  146. self:NetworkVar("Float",10,"FakeTimerShoot2") --Prediction
  147. self:NetworkVar("Float",11,"FakeTimerShoot3") --GuardBreak
  148. self:NetworkVar("Bool",0,"Sword_CanAttack") --Boy I wonder what this does???
  149. self:NetworkVar("Bool",1,"Shield_Canblock") --This Too???
  150. self:NetworkVar("Bool",2,"Shield_Blocking") --I'm gonna stop now, I'm a bit tired of thinking of witty remarks to write here
  151. self:NetworkVar("Bool",4,"Sword_Attacking") --Yep, gonna totally stop them
  152. self:NetworkVar("Bool",5,"Shield_Parrying") --Mmhmm
  153. self:NetworkVar("Bool",6,"Sword_Breaking") --I'm running out of retorts
  154. self:NetworkVar("Bool",7,"Sword_TPIdle")
  155. self:NetworkVar("Bool",8,"Sword_AlreadyAttacking") --Stabbing stuff
  156.  
  157. end
  158.  
  159. --Pitas Contributions
  160. function SWEP:Equip()
  161.  
  162. self.Primary.Damage = self.Primary.Damage + (CRAFTINGMOD.User[self.Owner:SteamID()].Levels.Stats.Strength.curLevel * 10)
  163. --print(self.PrintName .. " damage",self.Primary.Damage)
  164. self.SwingSpeed = self.SwingSpeed + (CRAFTINGMOD.User[self.Owner:SteamID()].Levels.Stats.Dexterity.curLevel * 0.05)
  165. --print(self.PrintName .. " swing speed",self.SwingSpeed)
  166.  
  167. end
  168.  
  169.  
  170. function SWEP:Think()
  171.  
  172. -- First comes worlmodel positioning
  173. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1") != nil then
  174. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1"), Angle(-10,-40,0) )
  175. end
  176. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11") != nil then
  177. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11"), Angle(0,-65,0) )
  178. end
  179. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1") != nil then
  180. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1"), Angle(-10,-20,0) )
  181. end
  182. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11") != nil then
  183. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11"), Angle(0,-35,0) )
  184. end
  185. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Hand") != nil then
  186. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Hand"), Angle(0,-30,0) )
  187. end
  188. if self:GetShield_Model() == 0 then
  189. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  190. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(20,40,0) )
  191. end
  192. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  193. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,50,0) )
  194. end
  195. elseif self.Owner:GetNWInt("BuuSwords_ResetBonesSheild") == true then
  196. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  197. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  198. end
  199. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  200. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  201. end
  202. self.Owner:SetNWInt("BuuSwords_ResetBonesSheild",false)
  203. end
  204.  
  205. self.Owner:GetViewModel():SetPlaybackRate(self.SwingSpeed)
  206.  
  207. -- Next comes blocking code
  208. if self:GetShield_Model() != 0 && !self.Owner:KeyDown(IN_USE) && self.Owner:KeyPressed(IN_ATTACK2) && self:GetShield_Canblock() == true then
  209. self:SetShield_Canblock(false)
  210. self:SetSword_CanAttack(false)
  211. self.Owner:ResetLuaAnimation("sword_godefend")
  212. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "idle_to_blocked" ))
  213. self:SetShield_FakeTimer1(CurTime() + (self.Owner:GetViewModel():SequenceDuration() * (1/self.SwingSpeed)))
  214. end
  215.  
  216. if self:GetShield_Model() != 0 && !self.Owner:KeyDown(IN_ATTACK2) && self:GetShield_Blocking() == true then
  217. self:SetShield_Blocking(false)
  218. self.Owner:ResetLuaAnimation("sword_leavedefend")
  219. self.Owner:StopLuaAnimation("sword_godefend")
  220. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "blocked_to_idle" ))
  221. self:SetShield_FakeTimer2(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  222. if SERVER then
  223. if(self.Shield and self.Shield:IsValid()) then
  224. self.Shield:Remove()
  225. return true
  226. end
  227. end
  228. end
  229. if SERVER then
  230. if self:GetShield_Blocking() == false && IsValid(self.Shield) then
  231. self.Shield:Remove()
  232. end
  233. end
  234. if SERVER then --Position our shield with the player
  235. if(self.Shield and self.Shield:IsValid()) then
  236. local Offset = Vector(16,-5,0)
  237. if(self.Owner:Crouching()) then
  238. Offset.z = Offset.z - 0
  239. Offset.x = Offset.x + 0
  240. end
  241. local Pos, Ang = LocalToWorld(Offset,Angle(5,0,0),self.Owner:GetPos(),Angle(0,self.Owner:GetAngles().y,0))
  242. self.Shield:SetAngles(Ang)
  243. self.Shield:SetPos(Pos)
  244. end
  245. end
  246.  
  247. -- Now comes Parrying
  248. if self:GetShield_Model() != 0 && !self.Owner:KeyDown(IN_USE) && self.Owner:KeyPressed(IN_RELOAD) && self:GetShield_Canblock() == true then
  249. self:SetShield_Canblock(false)
  250. self:SetSword_CanAttack(false)
  251. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "parry" ))
  252. self.Owner:ResetLuaAnimation("sword_parry")
  253. self:SetSword_FakeTimer4(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  254. self:SetShield_Parrying(true)
  255. self:SetShield_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()*0.3* (1/self.SwingSpeed))
  256. end
  257.  
  258. -- Guard breaking is now
  259. if self.Owner:KeyDown(IN_USE) && self.Owner:KeyPressed(IN_RELOAD) && self:GetShield_Canblock() == true then
  260. self:SetShield_Canblock(false)
  261. self:SetSword_CanAttack(false)
  262. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "Attack_Break" ))
  263. self:SetFakeTimerShoot3(CurTime() + self.Owner:GetViewModel():SequenceDuration()*0.2* (1/self.SwingSpeed))
  264. if self:GetShield_Model() != 0 then
  265. self.Owner:ResetLuaAnimation("sword_break")
  266. else
  267. self.Owner:ResetLuaAnimation("sword_break_noshield")
  268. end
  269. self:SetSword_FakeTimer4(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  270. self:SetShield_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()*0.3* (1/self.SwingSpeed))
  271. end
  272.  
  273. -- Timers, yay!!! Had to make my own so this base would be fully predicted
  274. -- Decided to organize it like this for reading's sake
  275. self:IdleStuff_Timer1()
  276. self:StunStuff_Timer1()
  277. self:ParryStuff_Timer1()
  278. self:AttackStuff_Damage()
  279. self:AttackStuff_DamageParry()
  280. self:AttackStuff_DamageBreak()
  281. self:AttackStuff_Timer1()
  282. self:AttackStuff_Timer2()
  283. self:AttackStuff_Timer3()
  284. self:AttackStuff_Timer4()
  285. self:AttackStuff_Timer5()
  286. self:DefendStuff_Timer1()
  287. self:DefendStuff_Timer2()
  288.  
  289. -- Since I wanted fancy holster animations, had to make some code which sets the weapon to holster to
  290. if self.Owner:GetNWBool("Holstered") == true then
  291. if (CLIENT or game.SinglePlayer()) && IsValid(self.Weapon) && IsValid(self.Owner) then
  292. self:SetSword_TPIdle(false)
  293. self:Holster()
  294. if IsValid(self.Owner) && self.Owner:GetNWEntity("WeaponToHolsterTo"):GetClass() != nil then
  295. self.Owner:ConCommand("use "..self.Owner:GetNWEntity("WeaponToHolsterTo"):GetClass())
  296. end
  297. end
  298. end
  299.  
  300. self:SetShield_Model(self.Owner:GetNWInt("BuuSwords_CurrentShield",0))
  301. self.Owner:GetViewModel():SetBodygroup(2,self.Owner:GetNWInt("BuuSwords_CurrentShield",0))
  302.  
  303. --Amazing Chest Ahead
  304. end
  305.  
  306. -- Shwing
  307. function SWEP:Deploy()
  308. self:SetSword_TPIdle(false)
  309. self.Owner:GetViewModel():SetBodygroup(1,self.ModelGroup)
  310. self.Owner:GetViewModel():SetBodygroup(2,self:GetShield_Model())
  311. self.Owner:SetNWEntity("WeaponToHolsterTo",nil)
  312. self.Owner:SetNWBool("Holstered",false)
  313. self:SetShield_Canblock(false)
  314. self:SetSword_AttackType(0)
  315. self:SetSword_CanAttack(false)
  316. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "draw" ) )
  317. self.Weapon:SetNextPrimaryFire( CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) )
  318. self:SetSword_FakeTimer4(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  319. if self:GetShield_Model() != 0 then
  320. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  321. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  322. end
  323. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  324. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  325. end
  326. else
  327. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  328. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(20,40,0) )
  329. end
  330. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  331. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,50,0) )
  332. end
  333. end
  334. return true
  335. end
  336.  
  337. function SWEP:OnRemove()
  338. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1") != nil then
  339. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1"), Angle(0,0,0) )
  340. end
  341. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11") != nil then
  342. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11"), Angle(0,0,0) )
  343. end
  344. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1") != nil then
  345. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1"), Angle(0,0,0) )
  346. end
  347. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11") != nil then
  348. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11"), Angle(0,0,0) )
  349. end
  350. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Hand") != nil then
  351. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Hand"), Angle(0,0,0) )
  352. end
  353. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  354. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  355. end
  356. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  357. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  358. end
  359. if SERVER then
  360. if(self.Shield and self.Shield:IsValid()) then
  361. self.Shield:Remove()
  362. return true
  363. end
  364. end
  365. end
  366.  
  367. -- Putting the sword back in it's sheath
  368. function SWEP:Holster(weapon)
  369. if self.Owner:GetNWBool("Holstered") == true then
  370. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1") != nil then
  371. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1"), Angle(0,0,0) )
  372. end
  373. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11") != nil then
  374. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11"), Angle(0,0,0) )
  375. end
  376. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1") != nil then
  377. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1"), Angle(0,0,0) )
  378. end
  379. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11") != nil then
  380. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11"), Angle(0,0,0) )
  381. end
  382. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Hand") != nil then
  383. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Hand"), Angle(0,0,0) )
  384. end
  385. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  386. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
  387. end
  388. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  389. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
  390. end
  391. return true
  392. end
  393.  
  394. self.Owner:Freeze(false)
  395.  
  396. if SERVER && !self.Owner:KeyDown(IN_ATTACK2) then
  397. if(self.Shield and self.Shield:IsValid()) then
  398. self.Shield:Remove()
  399. end
  400. end
  401.  
  402. if self and self.Weapon and IsValid(self.Weapon) && self:GetShield_Canblock() == true && self:GetSword_CanAttack() == true then
  403. self:SetShield_Canblock(false)
  404. self:SetSword_AttackType(0)
  405. self:SetSword_CanAttack(false)
  406. if IsValid(self.Owner) && IsValid(self.Owner:GetViewModel()) then
  407. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "holster" ) )
  408. end
  409. if self.Owner:GetNWBool("Holstered") == false then
  410. if !IsValid(self.Weapon) then return end
  411. timer.Simple(1, function()
  412. if !IsValid(self.Weapon) then return end
  413. self.Owner:SetNWEntity("WeaponToHolsterTo",weapon)
  414. self.Owner:SetNWBool("Holstered",true)
  415. end)
  416. end
  417. end
  418.  
  419. end
  420.  
  421. -- Garry's Mod should do this automatically ._.
  422. function SWEP:Initialize()
  423. self:SetHoldType(self.HoldType)
  424. self:SetShield_Model(self.Owner:GetNWInt("BuuSwords_StartingShield",0))
  425. end
  426.  
  427. -- Real men code their own SecondaryAttack in SWEP:Think()
  428. -- Except when that stuff is related to Derma
  429. -- KeyPressed should only check WHEN THE KEY IS PRESSED BUT NOOOOOO. THAT WOULD BE TOO LOGICAL.
  430. function SWEP:SecondaryAttack()
  431. -- Shield Menu Stuff
  432. if self.Owner:KeyDown(IN_USE) then
  433. if !game.SinglePlayer() then
  434. if CLIENT then
  435. if LocalPlayer():GetNWInt("BuuSwords_testblocking",0) == 1 then return end
  436. LocalPlayer():SetNWInt("BuuSwords_testblocking",1)
  437. local Width = 656
  438. local Height = 122
  439. local Frame = vgui.Create( "DFrame" )
  440. Frame:SetPos( (ScrW()/2)-(Width/2), (ScrH()/2 )-(Height/2))
  441. Frame:SetSize( Width, Height )
  442. Frame:SetTitle( "Shield Selection" )
  443. Frame:SetVisible( true )
  444. Frame:SetDraggable( false )
  445. Frame:ShowCloseButton( true )
  446. Frame:MakePopup()
  447. function Frame:OnClose()
  448. LocalPlayer():SetNWInt("BuuSwords_testblocking",0)
  449. end
  450. Frame.Paint = function()
  451. draw.RoundedBox( 2, 0, 0, Frame:GetWide(), Frame:GetTall(), Color( 0, 0, 0, 150 ) )
  452. end
  453. local model = "models/weapons/w_bs_broadsword.mdl"
  454. BGPanel = vgui.Create( "DPanel",Frame )
  455. BGPanel:SetPos( 16, 40 )
  456. BGPanel:SetSize( 64, 64 )
  457. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  458. mdl:SetSize( BGPanel:GetSize() )
  459. mdl:SetModel( model )
  460. function mdl:DoClick()
  461. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",0)
  462. net.Start( "ChangeShieldBuu" )
  463. net.WriteUInt( 0, 8 )
  464. net.SendToServer()
  465. end
  466.  
  467. if LocalPlayer():GetNWBool( "BuuSwords_Has_Bouche") == true then
  468. local model = "models/weapons/w_bs_shield_bouche.mdl"
  469. BGPanel = vgui.Create( "DPanel",Frame )
  470. BGPanel:SetPos( 96, 40 )
  471. BGPanel:SetSize( 64, 64 )
  472. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  473. mdl:SetSize( BGPanel:GetSize() )
  474. mdl:SetModel( model )
  475. function mdl:DoClick()
  476. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",1)
  477. net.Start( "ChangeShieldBuu" )
  478. net.WriteUInt( 1, 8 )
  479. net.SendToServer()
  480. end
  481. end
  482.  
  483. if LocalPlayer():GetNWBool( "BuuSwords_Has_Buckler") == true then
  484. local model = "models/weapons/w_bs_shield_Buckler.mdl"
  485. BGPanel = vgui.Create( "DPanel",Frame )
  486. BGPanel:SetPos( 176, 40 )
  487. BGPanel:SetSize( 64, 64 )
  488. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  489. mdl:SetSize( BGPanel:GetSize() )
  490. mdl:SetModel( model )
  491. function mdl:DoClick()
  492. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",2)
  493. net.Start( "ChangeShieldBuu" )
  494. net.WriteUInt( 2, 8 )
  495. net.SendToServer()
  496. end
  497. end
  498.  
  499. if LocalPlayer():GetNWBool( "BuuSwords_Has_Crest") == true then
  500. local model = "models/weapons/w_bs_shield_Crest.mdl"
  501. BGPanel = vgui.Create( "DPanel",Frame )
  502. BGPanel:SetPos( 256, 40 )
  503. BGPanel:SetSize( 64, 64 )
  504. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  505. mdl:SetSize( BGPanel:GetSize() )
  506. mdl:SetModel( model )
  507. function mdl:DoClick()
  508. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",3)
  509. net.Start( "ChangeShieldBuu" )
  510. net.WriteUInt( 3, 8 )
  511. net.SendToServer()
  512. end
  513. end
  514.  
  515. if LocalPlayer():GetNWBool( "BuuSwords_Has_Heater") == true then
  516. local model = "models/weapons/w_bs_shield_Heater.mdl"
  517. BGPanel = vgui.Create( "DPanel",Frame )
  518. BGPanel:SetPos( 336, 40 )
  519. BGPanel:SetSize( 64, 64 )
  520. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  521. mdl:SetSize( BGPanel:GetSize() )
  522. mdl:SetModel( model )
  523. function mdl:DoClick()
  524. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",4)
  525. net.Start( "ChangeShieldBuu" )
  526. net.WriteUInt( 4, 8 )
  527. net.SendToServer()
  528. end
  529. end
  530.  
  531. if LocalPlayer():GetNWBool( "BuuSwords_Has_Kite") == true then
  532. local model = "models/weapons/w_bs_shield_Kite.mdl"
  533. BGPanel = vgui.Create( "DPanel",Frame )
  534. BGPanel:SetPos( 416, 40 )
  535. BGPanel:SetSize( 64, 64 )
  536. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  537. mdl:SetSize( BGPanel:GetSize() )
  538. mdl:SetModel( model )
  539. function mdl:DoClick()
  540. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",5)
  541. net.Start( "ChangeShieldBuu" )
  542. net.WriteUInt( 5, 8 )
  543. net.SendToServer()
  544. end
  545. end
  546.  
  547. if LocalPlayer():GetNWBool( "BuuSwords_Has_Scutum") == true then
  548. local model = "models/weapons/w_bs_shield_Scutum.mdl"
  549. BGPanel = vgui.Create( "DPanel",Frame )
  550. BGPanel:SetPos( 496, 40 )
  551. BGPanel:SetSize( 64, 64 )
  552. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  553. mdl:SetSize( BGPanel:GetSize() )
  554. mdl:SetModel( model )
  555. function mdl:DoClick()
  556. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",6)
  557. net.Start( "ChangeShieldBuu" )
  558. net.WriteUInt( 6, 8 )
  559. net.SendToServer()
  560. end
  561. end
  562.  
  563. if LocalPlayer():GetNWBool( "BuuSwords_Has_Targe") == true then
  564. local model = "models/weapons/w_bs_shield_targe.mdl"
  565. BGPanel = vgui.Create( "DPanel",Frame )
  566. BGPanel:SetPos( 576, 40 )
  567. BGPanel:SetSize( 64, 64 )
  568. local mdl = vgui.Create( "SpawnIcon", BGPanel )
  569. mdl:SetSize( BGPanel:GetSize() )
  570. mdl:SetModel( model )
  571. function mdl:DoClick()
  572. LocalPlayer():SetNWInt("BuuSwords_CurrentShield",7)
  573. net.Start( "ChangeShieldBuu" )
  574. net.WriteUInt( 7, 8 )
  575. net.SendToServer()
  576. end
  577. end
  578. end
  579. else
  580. self.Owner:ConCommand("Buu_ShieldMenu")
  581. end
  582. end
  583. end
  584.  
  585. --Frontstab? stuff
  586. function SWEP:EntsInSphereFront( pos, range )
  587. local ents = ents.FindInSphere(pos,range)
  588. for k, v in pairs(ents) do
  589. if v != self and v != self.Owner and (v:IsNPC() or v:IsPlayer()) and IsValid(v) and self:EntityFaceFront(v) then
  590. return true
  591. end
  592. end
  593. return false
  594. end
  595.  
  596. function SWEP:EntityFaceFront(ent)
  597. local angle = self.Owner:GetAngles().y -ent:GetAngles().y
  598. if angle < -180 then angle = 360 +angle end
  599. if angle <= 90 and angle >= -90 then return false end
  600. return true
  601. end
  602.  
  603.  
  604. function SWEP:CheckFrontStab()
  605. local tr = {}
  606. tr.start = self.Owner:GetShootPos()
  607. tr.endpos = self.Owner:GetShootPos() + ( self.Owner:GetAimVector() * self.Reach )
  608. tr.filter = self.Owner
  609. tr.mask = MASK_SHOT
  610. local trace = util.TraceLine( tr )
  611. local pos = self.Owner:GetShootPos()
  612. local ang = self.Owner:GetAimVector()
  613. local tracedata = {}
  614. tracedata.start = pos
  615. tracedata.endpos = pos +(self.Owner:GetAimVector( ) *66)
  616. tracedata.filter = self.Owner
  617. local tr = util.TraceLine(tracedata)
  618. if (tr.Entity and IsValid(tr.Entity) and (tr.Entity:IsNPC() or tr.Entity:IsPlayer()) and self:EntityFaceFront(tr.Entity)) or self:EntsInSphereFront( tracedata.endpos,12 ) then
  619. return true
  620. else
  621. return false
  622. end
  623. end
  624.  
  625. -- Does the killing
  626. function SWEP:PrimaryAttack()
  627. --Be wary of Tears
  628. if self:GetSword_CanAttack() == false then return end
  629. self:SetSword_AlreadyAttacking(false)
  630. self:SetShield_Canblock(false)
  631. self:SetSword_FakeTimer1(0)
  632. self:SetSword_FakeTimer2(0)
  633. self:SetSword_FakeTimer3(0)
  634.  
  635. local tr = util.TraceLine( {
  636. start = self.Owner:GetShootPos(),
  637. endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
  638. filter = self.Owner,
  639. mask = MASK_SHOT_HULL
  640. } )
  641.  
  642. if ( !IsValid( tr.Entity ) ) then
  643. tr = util.TraceHull( {
  644. start = self.Owner:GetShootPos(),
  645. endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
  646. filter = self.Owner,
  647. mins = Vector( -10, -10, -8 ),
  648. maxs = Vector( 10, 10, 8 ),
  649. mask = MASK_SHOT_HULL
  650. } )
  651. end
  652.  
  653.  
  654. -- Note to future self: I'm sorry for below
  655.  
  656. if self:GetSword_AttackType() > 2 then
  657. self:SetSword_AttackType(1)
  658. end
  659. if !IsValid(self.Weapon) then return end
  660. if self:GetSword_AttackType() == 2 then
  661. if tr.Hit && IsValid( tr.Entity ) && ((tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetSword_Stunned() > 0 ) || ((tr.Entity:IsPlayer() || tr.Entity:IsNPC()) && math.abs(math.AngleDifference(tr.Entity:GetAngles().y,self.Owner:GetAngles().y)) <= 50)) then
  662. if self:GetShield_Model() != 0 then
  663. self.Owner:ResetLuaAnimation("sword_attackstab")
  664. else
  665. self.Owner:ResetLuaAnimation("sword_attackstab_noshield")
  666. end
  667. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack_stab" ) )
  668. self:SetSword_CanAttack(false)
  669. self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  670. self:SetSword_AttackType(0)
  671. if tr.Hit && IsValid( tr.Entity ) && (tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetSword_Stunned() > 0 ) then
  672. self:SetFakeTimerShoot2(CurTime() + (self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.2))
  673. end
  674. else
  675. self.Owner:ViewPunch( Angle( 2, 2, 0 ) )
  676. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack3" ) )
  677. if self:GetShield_Model() != 0 then
  678. self.Owner:ResetLuaAnimation("sword_attack1")
  679. else
  680. self.Owner:ResetLuaAnimation("sword_attack1_noshield")
  681. end
  682. self:SetSword_AttackType(3)
  683. self:SetSword_CanAttack(false)
  684. self:SetSword_AttackingTimer(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.15)
  685. self.Weapon:SetNextPrimaryFire( CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.5 )
  686. self:SetSword_FakeTimer1(CurTime() + self.Owner:GetViewModel():SequenceDuration()* ( 1/self.SwingSpeed)*0.5)
  687. self:SetSword_FakeTimer2(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.7)
  688. self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  689. end
  690. end
  691.  
  692. if self:GetSword_AttackType() == 1 then
  693. if tr.Hit && IsValid( tr.Entity ) && ((tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetSword_Stunned() > 0 ) || ((tr.Entity:IsPlayer() || tr.Entity:IsNPC()) && math.abs(math.AngleDifference(tr.Entity:GetAngles().y,self.Owner:GetAngles().y)) <= 50)) then
  694. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack_stab" ) )
  695. self:SetSword_CanAttack(false)
  696. self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  697. self:SetSword_AttackType(0)
  698. if self:GetShield_Model() != 0 then
  699. self.Owner:ResetLuaAnimation("sword_attackstab")
  700. else
  701. self.Owner:ResetLuaAnimation("sword_attackstab_noshield")
  702. end
  703. self:SetFakeTimerShoot2(CurTime() + (self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.2))
  704. if tr.Hit && IsValid( tr.Entity ) && (tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetSword_Stunned() > 0 ) then
  705. self:SetFakeTimerShoot2(CurTime() + (self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.2))
  706. end
  707. else
  708. self.Owner:ViewPunch( Angle( -2, -2, 0 ) )
  709. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack2" ) )
  710. if self:GetShield_Model() != 0 then
  711. self.Owner:ResetLuaAnimation("sword_attack2")
  712. else
  713. self.Owner:ResetLuaAnimation("sword_attack2_noshield")
  714. end
  715. self:SetSword_AttackType(2)
  716. self:SetSword_CanAttack(false)
  717. self:SetSword_AttackingTimer(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.15)
  718. self.Weapon:SetNextPrimaryFire( CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.5 )
  719. self:SetSword_FakeTimer1(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.5)
  720. self:SetSword_FakeTimer2(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.7)
  721. self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  722. end
  723. end
  724.  
  725. if self:GetSword_AttackType() == 0 then
  726. self.Owner:ViewPunch( Angle( 2, 2, 0 ) )
  727. if tr.Hit && IsValid( tr.Entity ) && ((tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetSword_Stunned() > 0 ) || ((tr.Entity:IsPlayer() || tr.Entity:IsNPC()) && math.abs(math.AngleDifference(tr.Entity:GetAngles().y,self.Owner:GetAngles().y)) <= 50)) then
  728. if self:GetShield_Model() != 0 then
  729. self.Owner:ResetLuaAnimation("sword_attackstab")
  730. else
  731. self.Owner:ResetLuaAnimation("sword_attackstab_noshield")
  732. end
  733. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack_stab" ) )
  734. self:SetSword_CanAttack(false)
  735. self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  736. self:SetSword_AttackType(0)
  737. if tr.Hit && IsValid( tr.Entity ) && (tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetSword_Stunned() > 0 ) then
  738. self:SetFakeTimerShoot2(CurTime() + (self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.2))
  739. end
  740. else
  741. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack1" ) )
  742. if self:GetShield_Model() != 0 then
  743. self.Owner:ResetLuaAnimation("sword_attack1")
  744. else
  745. self.Owner:ResetLuaAnimation("sword_attack1_noshield")
  746. end
  747. self:SetSword_AttackType(1)
  748. self:SetSword_CanAttack(false)
  749. self.Weapon:SetNextPrimaryFire( CurTime() * self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) *0.4 )
  750. self:SetSword_AttackingTimer(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.15)
  751. self:SetSword_FakeTimer1(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.4)
  752. self:SetSword_FakeTimer2(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.6)
  753. self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  754. end
  755. end
  756.  
  757. self:SetFakeTimerShoot(CurTime() + (self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.2))
  758. end
  759.  
  760. -- Makes it look like the player has Parkinson's. Also sets variables and stuff
  761. function SWEP:GotoIdleAnim()
  762. self:SetSword_TPIdle(true)
  763. self:SetSword_AlreadyAttacking(false)
  764. self:SetShield_Canblock(true)
  765. self:SetSword_AttackType(0)
  766. self:SetSword_CanAttack(true)
  767. self.CanUnblock = true
  768. if !IsValid(self.Weapon) then return end
  769. if !IsValid(self.Owner:GetViewModel()) then return end
  770. self.Owner:GetViewModel():ResetSequence( self.Owner:GetViewModel():LookupSequence( "idle" ) )
  771. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1") != nil then
  772. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1"), Angle(-10,-40,0) )
  773. end
  774. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11") != nil then
  775. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11"), Angle(0,-65,0) )
  776. end
  777. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1") != nil then
  778. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1"), Angle(-10,-20,0) )
  779. end
  780. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11") != nil then
  781. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11"), Angle(0,-35,0) )
  782. end
  783. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Hand") != nil then
  784. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Hand"), Angle(0,-30,0) )
  785. end
  786. if self:GetShield_Model() == 0 then
  787. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  788. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(20,40,0) )
  789. end
  790. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  791. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,50,0) )
  792. end
  793. end
  794.  
  795. end
  796.  
  797. -- I put the damage tracing here for readability's sake. However please don't read this because it's not very good.
  798.  
  799. function SWEP:AttackStuff_DamageParry()
  800. if CurTime() > self:GetFakeTimerShoot2() && self:GetFakeTimerShoot2() > 0 then
  801. self:SetFakeTimerShoot2(0)
  802. self:SetFakeTimerShoot(0)
  803. local tr = util.TraceLine( {
  804. start = self.Owner:GetShootPos(),
  805. endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
  806. filter = self.Owner,
  807. mask = MASK_SHOT_HULL
  808. } )
  809.  
  810. if ( !IsValid( tr.Entity ) ) then
  811. tr = util.TraceHull( {
  812. start = self.Owner:GetShootPos(),
  813. endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
  814. filter = self.Owner,
  815. mins = Vector( -10, -10, -8 ),
  816. maxs = Vector( 10, 10, 8 ),
  817. mask = MASK_SHOT_HULL
  818. } )
  819. end
  820. if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() || tr.Entity:Health() > 0 ) ) then
  821. local dmginfo = DamageInfo()
  822.  
  823. local attacker = self.Owner
  824. if ( !IsValid( attacker ) ) then attacker = self end
  825. dmginfo:SetAttacker( attacker )
  826. dmginfo:SetInflictor( self )
  827. dmginfo:SetDamage( self.Primary.Damage*10 )
  828. dmginfo:SetDamageForce( self.Owner:GetForward() * 10000 )
  829. if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() || tr.Entity:Health() > 0 ) ) && IsFirstTimePredicted() then
  830. tr.Entity:TakeDamageInfo( dmginfo )
  831. end
  832. end
  833. if ( SERVER && IsValid( tr.Entity ) ) then
  834. local phys = tr.Entity:GetPhysicsObject()
  835. if ( IsValid( phys ) ) then
  836. phys:ApplyForceOffset( self.Owner:GetAimVector() * self.Reach * phys:GetMass(), tr.HitPos )
  837. end
  838. end
  839. local tr = {}
  840. tr.start = self.Owner:GetShootPos()
  841. tr.endpos = self.Owner:GetShootPos() + ( self.Owner:GetAimVector() * (self.Reach+10.7) )
  842. tr.filter = self.Owner
  843. tr.mask = MASK_SHOT
  844. local trace = util.TraceLine( tr )
  845. if ( trace.Hit ) then
  846. bullet = {}
  847. bullet.Num = 1
  848. bullet.Src = self.Owner:GetShootPos()
  849. bullet.Dir = self.Owner:GetAimVector()
  850. bullet.Spread = Vector(0, 0, 0)
  851. bullet.Tracer = 0
  852. bullet.Force = 1
  853. bullet.Damage = 0
  854. self.Owner:FireBullets(bullet)
  855. end
  856. end
  857. end
  858.  
  859. function SWEP:AttackStuff_DamageBreak()
  860. if CurTime() > self:GetFakeTimerShoot3() && self:GetFakeTimerShoot3() > 0 then
  861. self:SetFakeTimerShoot3(0)
  862. local tr = util.TraceLine( {
  863. start = self.Owner:GetShootPos(),
  864. endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
  865. filter = self.Owner,
  866. mask = MASK_SHOT_HULL
  867. } )
  868.  
  869. if ( !IsValid( tr.Entity ) ) then
  870. tr = util.TraceHull( {
  871. start = self.Owner:GetShootPos(),
  872. endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
  873. filter = self.Owner,
  874. mins = Vector( -10, -10, -8 ),
  875. maxs = Vector( 10, 10, 8 ),
  876. mask = MASK_SHOT_HULL
  877. } )
  878. end
  879.  
  880. if ( SERVER && IsValid( tr.Entity ) && tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetShield_Blocking() == true) then
  881. tr.Entity:GetViewModel():SendViewModelMatchingSequence( tr.Entity:GetViewModel():LookupSequence( "Block_Break" ) )
  882. tr.Entity:EmitSound( "weapons/DarkSouls/Parry_Sucess.wav" )
  883. tr.Entity:GetActiveWeapon():SetSword_Stunned(CurTime() + tr.Entity:GetViewModel():SequenceDuration()* (1/tr.Entity:GetActiveWeapon().SwingSpeed))
  884. tr.Entity:GetActiveWeapon():SetShield_Blocking(false)
  885. tr.Entity:ResetLuaAnimation("sword_stunned")
  886. tr.Entity:StopLuaAnimation("sword_godefend")
  887. if SERVER then
  888. if(tr.Entity:GetViewModel().Shield and tr.Entity:GetViewModel().Shield:IsValid()) then
  889. tr.Entity:GetViewModel().Shield:Remove()
  890. return true
  891. end
  892. end
  893. elseif (SERVER && IsValid( tr.Entity ) && tr.Entity:GetModel() == "models/weapons/w_ds_shieldhitbox.mdl" && tr.Entity:GetOwner():IsPlayer() && tr.Entity:GetOwner():IsPlayer() && tr.Entity:GetOwner():GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetOwner():GetActiveWeapon():GetShield_Blocking() == true) then
  894. tr.Entity:GetOwner():GetViewModel():SendViewModelMatchingSequence( tr.Entity:GetOwner():GetViewModel():LookupSequence( "Block_Break" ) )
  895. tr.Entity:GetOwner():EmitSound( "weapons/DarkSouls/Parry_Sucess.wav" )
  896. tr.Entity:GetOwner():GetActiveWeapon():SetSword_Stunned(CurTime() + tr.Entity:GetOwner():GetViewModel():SequenceDuration()* (1/tr.Entity:GetOwner():GetActiveWeapon().SwingSpeed))
  897. tr.Entity:GetOwner():GetActiveWeapon():SetShield_Blocking(false)
  898. tr.Entity:GetOwner():ResetLuaAnimation("sword_stunned")
  899. tr.Entity:GetOwner():StopLuaAnimation("sword_godefend")
  900. if SERVER then
  901. if(tr.Entity:GetOwner():GetViewModel().Shield and tr.Entity:GetOwner():GetViewModel().Shield:IsValid()) then
  902. tr.Entity:GetOwner():GetViewModel().Shield:Remove()
  903. return true
  904. end
  905. end
  906. end
  907. end
  908. end
  909.  
  910. function SWEP:AttackStuff_Damage()
  911. -- Visions of Despair, Try back
  912. local damage = self.Primary.Damage
  913. local force = 5000
  914. self.Owner:LagCompensation( true )
  915. if CurTime() > self:GetFakeTimerShoot() && self:GetFakeTimerShoot() > 0 && self:GetSword_AlreadyAttacking() == false then
  916. self:SetFakeTimerShoot(0)
  917. local tr = util.TraceLine( {
  918. start = self.Owner:GetShootPos(),
  919. endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
  920. filter = self.Owner,
  921. mask = MASK_SHOT_HULL
  922. } )
  923.  
  924. --PITAS CONTRIBUTIONS
  925. if self.Owner:GetEyeTrace().Entity:GetClass() == "training_dummy" then
  926. local steamID = self.Owner:SteamID()
  927. local chance = 5 -- 1/chance is the chance of getting xp
  928. local randnum = math.ceil(math.Rand(0,chance))
  929. if randnum == 1 then
  930. if CRAFTINGMOD.User[steamID] ~= nil then
  931. CRAFTINGMOD.User[steamID].Levels:AddExperience( "Strength", math.ceil(math.Rand(1,50)) , self.Owner ) ------THIS IS WHERE I ADDED THE TRAINING DUMMY (PITA)
  932. end
  933. elseif randnum == 2 then
  934.  
  935. if CRAFTINGMOD.User[steamID] ~= nil then
  936. CRAFTINGMOD.User[steamID].Levels:AddExperience( "Dexterity", math.ceil(math.Rand(1,50)) , self.Owner ) ------THIS IS WHERE I ADDED THE TRAINING DUMMY (PITA)
  937. end
  938.  
  939. end
  940. end
  941.  
  942. if self.Owner:GetEyeTrace().Entity:GetClass() == "farmingmod_cropplot" then
  943. self.Owner:GetEyeTrace().Entity:Remove()
  944.  
  945. end
  946.  
  947. if ( !IsValid( tr.Entity ) ) then
  948. tr = util.TraceHull( {
  949. start = self.Owner:GetShootPos(),
  950. endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
  951. filter = self.Owner,
  952. mins = Vector( -10, -10, -8 ),
  953. maxs = Vector( 10, 10, 8 ),
  954. mask = MASK_SHOT_HULL
  955. } )
  956. end
  957.  
  958. if tr.Hit && IsValid( tr.Entity ) && tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetShield_Blocking() == true && self:CheckFrontStab() then
  959. self:SetSword_FakeTimer1(0)
  960. self:SetSword_FakeTimer2(0)
  961. self:SetSword_FakeTimer3(0)
  962. self:SetSword_CanAttack(false)
  963.  
  964. if self:GetSword_AttackType() == 1 || self:GetSword_AttackType() == 3 then
  965. self.Owner:ViewPunch( Angle( -5, 0, 0 ) )
  966. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack1_fail" ) )
  967. else
  968. self.Owner:ViewPunch( Angle( 5, 0, 0 ) )
  969. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack2_fail" ) )
  970. end
  971. self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  972. self:EmitSound( "weapons/DarkSouls/block.wav" )
  973. elseif tr.Hit && IsValid( tr.Entity ) && tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetShield_Parrying() then
  974. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack_parry" ) )
  975. self:EmitSound( "weapons/DarkSouls/Parry_Sucess.wav" )
  976. self:SetSword_FakeTimer1(0)
  977. self:SetSword_FakeTimer2(0)
  978. self:SetSword_FakeTimer3(0)
  979. self:SetSword_Stunned(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  980. self.Owner:Freeze(true)
  981. self.Owner:ResetLuaAnimation("sword_stunned")
  982. self:SetSword_CanAttack(false)
  983. self:SetShield_Canblock(false)
  984. elseif tr.Hit && IsValid(tr.Entity) && (tr.Entity:IsPlayer() || tr.Entity:IsNPC() || tr.Entity:IsRagdoll() ) && !(math.abs(math.AngleDifference(tr.Entity:GetAngles().y,self.Owner:GetAngles().y)) <= 50) then
  985. if self:GetSword_AlreadyAttacking() == false && SERVER then
  986. self:SetSword_AlreadyAttacking(true)
  987. if tr.Entity:IsNPC() || tr.Entity:IsRagdoll() then
  988. tr.Entity:EmitSound( "weapons/DarkSouls/Swing_HitFlesh.wav" )
  989. end
  990. end
  991. elseif tr.Hit && IsValid( tr.Entity ) && ((tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetSword_Stunned() > 0) || ((tr.Entity:IsPlayer() || tr.Entity:IsNPC()) && (math.abs(math.AngleDifference(tr.Entity:GetAngles().y,self.Owner:GetAngles().y)) <= 50))) then --Witness me!
  992. if self:GetSword_AlreadyAttacking() == false && SERVER then
  993. self:SetSword_AlreadyAttacking(true)
  994. if !(self:GetSequenceName(self.Owner:GetViewModel():GetSequence()) == "attack_stab") then
  995. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack_stab" ) )
  996. self.Owner:ResetLuaAnimation("sword_attackstab")
  997. end
  998. if tr.Entity:IsNPC() then
  999. tr.Entity:EmitSound( "weapons/DarkSouls/Swing_HitPowerful.wav" )
  1000. end
  1001. end
  1002. damage = self.Primary.Damage*10
  1003. force = 10000
  1004.  
  1005. elseif tr.Hit && IsValid( tr.Entity ) && tr.Entity:Health() > 0 then
  1006. elseif tr.Hit then
  1007. self:SetSword_FakeTimer1(0)
  1008. self:SetSword_FakeTimer2(0)
  1009. self:SetSword_FakeTimer3(0)
  1010. self:SetSword_CanAttack(false)
  1011. if (self:GetSword_AttackType() == 1 || self:GetSword_AttackType() == 3) then
  1012. self.Owner:ViewPunch( Angle( -5, 0, 0 ) )
  1013. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack1_fail" ) )
  1014. self:EmitSound( "weapons/DarkSouls/Swing_HitStuff.wav" )
  1015. else
  1016. self.Owner:ViewPunch( Angle( 5, 0, 0 ) )
  1017. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack2_fail" ) )
  1018. end
  1019. self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
  1020. if tr.Entity:GetModel() == "models/weapons/w_ds_shieldhitbox.mdl" then
  1021. self:EmitSound( "weapons/DarkSouls/block.wav" )
  1022. else
  1023. self:EmitSound( "weapons/DarkSouls/Swing_HitWorld.wav" )
  1024. end
  1025. end
  1026.  
  1027.  
  1028. if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() || tr.Entity:Health() > 0 ) ) then
  1029. local dmginfo = DamageInfo()
  1030.  
  1031. local attacker = self.Owner
  1032. if ( !IsValid( attacker ) ) then attacker = self end
  1033. dmginfo:SetAttacker( attacker )
  1034. dmginfo:SetInflictor( self )
  1035. dmginfo:SetDamage( damage )
  1036. dmginfo:SetDamageForce( self.Owner:GetForward() * force )
  1037. if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() || tr.Entity:Health() > 0 )) && IsFirstTimePredicted() then
  1038. if tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetShield_Blocking() == true && !(math.abs(math.AngleDifference(tr.Entity:GetAngles().y,self.Owner:GetAngles().y)) <= 50) then
  1039. else
  1040. tr.Entity:TakeDamageInfo( dmginfo )
  1041. end
  1042. end
  1043. end
  1044. if ( SERVER && IsValid( tr.Entity ) ) then
  1045. local phys = tr.Entity:GetPhysicsObject()
  1046. if ( IsValid( phys ) ) then
  1047. phys:ApplyForceOffset( self.Owner:GetAimVector() * self.Reach * phys:GetMass(), tr.HitPos )
  1048. end
  1049. end
  1050.  
  1051. local tr = {}
  1052. tr.start = self.Owner:GetShootPos()
  1053. tr.endpos = self.Owner:GetShootPos() + ( self.Owner:GetAimVector() * (self.Reach+10.7) )
  1054. tr.filter = self.Owner
  1055. tr.mask = MASK_SHOT
  1056. local trace = util.TraceLine( tr )
  1057. if ( trace.Hit ) then
  1058. bullet = {}
  1059. bullet.Num = 1
  1060. bullet.Src = self.Owner:GetShootPos()
  1061. bullet.Dir = self.Owner:GetAimVector()
  1062. bullet.Spread = Vector(0, 0, 0)
  1063. bullet.Tracer = 0
  1064. bullet.Force = 1
  1065. bullet.Damage = 1
  1066. self.Owner:FireBullets(bullet)
  1067. end
  1068. end
  1069. self.Owner:LagCompensation( false )
  1070. end
  1071.  
  1072.  
  1073. function SWEP:SendDamage(damage,trace,force)
  1074.  
  1075. end
  1076.  
  1077. -- This is just timers from this point on
  1078. function SWEP:AttackStuff_Timer1()
  1079. if CurTime() > self:GetSword_FakeTimer1() && self:GetSword_FakeTimer1() > 0 then
  1080. self:SetSword_FakeTimer1( 0 )
  1081. self:SetSword_CanAttack(true)
  1082. self:SetSword_Attacking(false)
  1083. end
  1084. end
  1085.  
  1086. function SWEP:AttackStuff_Timer2()
  1087. if CurTime() > self:GetSword_FakeTimer2() && self:GetSword_FakeTimer2() > 0 then
  1088. self:SetSword_FakeTimer2(0)
  1089. self:SetSword_CanAttack(false)
  1090. end
  1091. end
  1092.  
  1093. function SWEP:AttackStuff_Timer3()
  1094. if CurTime() > self:GetSword_FakeTimer3() && self:GetSword_FakeTimer3() > 0 then
  1095. self:SetSword_FakeTimer3(0)
  1096. self:GotoIdleAnim()
  1097. end
  1098. end
  1099.  
  1100. function SWEP:AttackStuff_Timer4()
  1101. if CurTime() > self:GetSword_FakeTimer4() && self:GetSword_FakeTimer4() > 0 then
  1102. self:SetSword_FakeTimer4(0)
  1103. self:GotoIdleAnim()
  1104. end
  1105. end
  1106.  
  1107. function SWEP:AttackStuff_Timer5()
  1108. if CurTime() > self:GetSword_AttackingTimer() && self:GetSword_AttackingTimer() > 0 then
  1109. self:SetSword_AttackingTimer(0)
  1110. self:SetSword_Attacking(true)
  1111. if self:GetSword_AttackType() == 0 then
  1112. self:EmitSound( self.Primary.Sound1,75,100,1,CHAN_ITEM )
  1113. elseif self:GetSword_AttackType() == 1 then
  1114. self:EmitSound( self.Primary.Sound1,75,100,1,CHAN_ITEM )
  1115. elseif self:GetSword_AttackType() == 2 then
  1116. self:EmitSound( self.Primary.Sound2,75,100,1,CHAN_ITEM )
  1117. elseif self:GetSword_AttackType() == 3 then
  1118. self:EmitSound( self.Primary.Sound3,75,100,1,CHAN_ITEM )
  1119. end
  1120. end
  1121. end
  1122.  
  1123. function SWEP:ParryStuff_Timer1()
  1124. if CurTime() > self:GetShield_FakeTimer3() && self:GetShield_FakeTimer3() > 0 then
  1125. self:SetShield_FakeTimer3(0)
  1126. self:SetShield_Parrying(false)
  1127. end
  1128. end
  1129.  
  1130. function SWEP:StunStuff_Timer1()
  1131. if CurTime() > self:GetSword_Stunned() && self:GetSword_Stunned() > 0 then
  1132. self:SetSword_Stunned(0)
  1133. self.Owner:Freeze(false)
  1134. self:GotoIdleAnim()
  1135. end
  1136. end
  1137.  
  1138. -- Legend has it that someone will find these comments funny
  1139. function SWEP:DefendStuff_Timer1()
  1140. if CurTime() > self:GetShield_FakeTimer1() && self:GetShield_FakeTimer1() > 0 then
  1141. self:SetShield_Blocking(true)
  1142. if SERVER then
  1143. local Ent = ents.Create("prop_physics")
  1144. Ent:SetModel("models/weapons/w_ds_shieldhitbox.mdl")
  1145. Ent:SetOwner(self.Owner)
  1146. Ent:Spawn()
  1147. Ent:SetCollisionGroup(COLLISION_GROUP_WEAPON)
  1148. Ent:SetRenderMode( RENDERMODE_TRANSALPHA )
  1149. Ent:SetColor( Color( 255, 255, 255, 0 ) )
  1150. local phys = Ent:GetPhysicsObject()
  1151. phys:AddGameFlag(FVPHYSICS_NO_PLAYER_PICKUP)
  1152. phys:AddGameFlag(FVPHYSICS_NO_IMPACT_DMG)
  1153. phys:AddGameFlag(FVPHYSICS_NO_SELF_COLLISIONS)
  1154. phys:EnableMotion(false)
  1155. self.Shield = Ent
  1156. end
  1157. self:SetShield_FakeTimer1(0)
  1158. self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "blocked_idle" ))
  1159.  
  1160. end
  1161. end
  1162.  
  1163. function SWEP:DefendStuff_Timer2()
  1164. if CurTime() > self:GetShield_FakeTimer2() && self:GetShield_FakeTimer2() > 0 then
  1165. self:SetShield_Canblock(true)
  1166. self:SetShield_FakeTimer2(0)
  1167. self:GotoIdleAnim()
  1168. end
  1169. end
  1170.  
  1171. function SWEP:IdleStuff_Timer1()
  1172. if CurTime() > self:GetSword_FakeTimer4() && self:GetSword_FakeTimer4() > 0 then
  1173. self:SetSword_FakeTimer4(0)
  1174. self:GotoIdleAnim()
  1175. end
  1176. end
  1177.  
  1178. -- Sexy CalcView stuff. Who doesn't like this?
  1179. -- Mushroom Guy, I love you for showing me the awesomeness of Lerp <3333
  1180. if CLIENT then
  1181. local TestVector = Vector(0,0,0)
  1182. local TestVectorAngle = Vector(0,0,0)
  1183. local TestVector2 = Vector(0,0,0)
  1184. local TestVectorAngle2 = Vector(0,0,0)
  1185. local TestVectorTarget = Vector(0,0,0)
  1186. local TestVectorAngleTarget = Vector(0,0,0)
  1187. local CrouchAng=0
  1188. local CrouchAng2=0
  1189. -- Be wary of Fatty but try horse
  1190. function SWEP:GetViewModelPosition(pos, ang)
  1191. local ply = LocalPlayer()
  1192. local weapon = ply:GetActiveWeapon()
  1193.  
  1194. TestVector = LerpVector(10*FrameTime(),TestVector,TestVectorTarget)
  1195. TestVectorAngle = LerpVector(10*FrameTime(),TestVectorAngle,TestVectorAngleTarget)
  1196.  
  1197. ang:RotateAroundAxis(ang:Right(),TestVectorAngle.x )
  1198. ang:RotateAroundAxis(ang:Up(),TestVectorAngle.y )
  1199. ang:RotateAroundAxis(ang:Forward(),TestVectorAngle.z)
  1200.  
  1201. pos = pos + TestVector.z * ang:Up()
  1202. pos = pos + TestVector.y * ang:Forward()
  1203. pos = pos + TestVector.x * ang:Right()
  1204. local Tr = self.Owner:GetEyeTrace()
  1205.  
  1206. if self.Owner:KeyDown(IN_DUCK) then
  1207. TestVectorTarget = self.CrouchPos
  1208. else
  1209. TestVectorTarget = Vector(0,0,0)
  1210. TestVectorAngleTarget = Vector(0,0,0)
  1211. end
  1212. TestVectorTarget = TestVectorTarget + Vector(0 ,0 , 0- math.Clamp(self.Owner:GetVelocity().z / 200,-5,5))
  1213. if self.Owner:KeyDown(IN_DUCK) then
  1214. if CrouchAng < 1 then
  1215. CrouchAng = CrouchAng + 0.01
  1216. CrouchAng2 = CrouchAng2 - 0.01
  1217. end
  1218. else
  1219. if CrouchAng > 0 then
  1220. CrouchAng = CrouchAng - 0.01
  1221. CrouchAng2 = CrouchAng2 + 0.01
  1222. end
  1223. end
  1224. return pos, ang
  1225. end
  1226. end
  1227.  
  1228. -- Draws the picture of the sword in the weapon selection
  1229. function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha )
  1230.  
  1231. surface.SetDrawColor( 255, 255, 255, alpha )
  1232. surface.SetTexture( self.WepSelectIcon )
  1233.  
  1234. y = y + 20
  1235. x = x + 40
  1236. wide = wide - 30
  1237.  
  1238. surface.DrawTexturedRect( x, y, wide/1.5, tall/1.5 )
  1239.  
  1240. end
  1241.  
  1242. function SWEP:DrawWorldModel()
  1243.  
  1244. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1") != nil then
  1245. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1"), Angle(-10,-40,0) )
  1246. end
  1247. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11") != nil then
  1248. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11"), Angle(0,-65,0) )
  1249. end
  1250. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1") != nil then
  1251. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1"), Angle(-10,-20,0) )
  1252. end
  1253. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11") != nil then
  1254. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11"), Angle(0,-35,0) )
  1255. end
  1256. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Hand") != nil then
  1257. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Hand"), Angle(0,-30,0) )
  1258. end
  1259. if self:GetShield_Model() == 0 then
  1260. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
  1261. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(20,40,0) )
  1262. end
  1263. if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
  1264. self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,50,0) )
  1265. end
  1266. end
  1267.  
  1268. self:SetMoveType( MOVETYPE_NONE )
  1269. self:SetParent( self.Owner, -1 )
  1270. self:SetBodygroup(1,self:GetShield_Model())
  1271. self:SetModelScale(1,1,1)
  1272. self:DrawModel()
  1273.  
  1274. end
  1275.  
  1276. RegisterLuaAnimation('sword_attack1', {
  1277. FrameData = {
  1278. {
  1279. BoneInfo = {
  1280. ['ValveBiped.Bip01_R_UpperArm'] = {
  1281. },
  1282. ['ValveBiped.Bip01_L_UpperArm'] = {
  1283. },
  1284. ['ValveBiped.Bip01_R_Forearm'] = {
  1285. }
  1286. },
  1287. FrameRate = 8
  1288. },
  1289. {
  1290. BoneInfo = {
  1291. ['ValveBiped.Bip01_R_UpperArm'] = {
  1292. RU = -48
  1293. },
  1294. ['ValveBiped.Bip01_L_UpperArm'] = {
  1295. RF = -48
  1296. },
  1297. ['ValveBiped.Bip01_R_Forearm'] = {
  1298. }
  1299. },
  1300. FrameRate = 7
  1301. },
  1302. {
  1303. BoneInfo = {
  1304. ['ValveBiped.Bip01_L_UpperArm'] = {
  1305. RF = -48
  1306. },
  1307. ['ValveBiped.Bip01_R_UpperArm'] = {
  1308. RU = -16,
  1309. RR = -16,
  1310. RF = -32
  1311. },
  1312. ['ValveBiped.Bip01_R_Forearm'] = {
  1313. RU = 64
  1314. }
  1315. },
  1316. FrameRate = 5
  1317. },
  1318. {
  1319. BoneInfo = {
  1320. ['ValveBiped.Bip01_R_UpperArm'] = {
  1321. },
  1322. ['ValveBiped.Bip01_L_UpperArm'] = {
  1323. },
  1324. ['ValveBiped.Bip01_R_Forearm'] = {
  1325. }
  1326. },
  1327. FrameRate = 4
  1328. }
  1329. },
  1330. Type = TYPE_GESTURE
  1331. })
  1332.  
  1333. RegisterLuaAnimation('sword_attack1_noshield', {
  1334. FrameData = {
  1335. {
  1336. BoneInfo = {
  1337. ['ValveBiped.Bip01_R_UpperArm'] = {
  1338. },
  1339. ['ValveBiped.Bip01_R_Forearm'] = {
  1340. }
  1341. },
  1342. FrameRate = 8
  1343. },
  1344. {
  1345. BoneInfo = {
  1346. ['ValveBiped.Bip01_R_UpperArm'] = {
  1347. RU = -48
  1348. },
  1349. ['ValveBiped.Bip01_R_Forearm'] = {
  1350. }
  1351. },
  1352. FrameRate = 7
  1353. },
  1354. {
  1355. BoneInfo = {
  1356. ['ValveBiped.Bip01_R_UpperArm'] = {
  1357. RU = -16,
  1358. RR = -16,
  1359. RF = -32
  1360. },
  1361. ['ValveBiped.Bip01_R_Forearm'] = {
  1362. RU = 64
  1363. }
  1364. },
  1365. FrameRate = 5
  1366. },
  1367. {
  1368. BoneInfo = {
  1369. ['ValveBiped.Bip01_R_UpperArm'] = {
  1370. },
  1371. ['ValveBiped.Bip01_R_Forearm'] = {
  1372. }
  1373. },
  1374. FrameRate = 4
  1375. }
  1376. },
  1377. Type = TYPE_GESTURE
  1378. })
  1379.  
  1380. RegisterLuaAnimation('sword_attack2', {
  1381. FrameData = {
  1382. {
  1383. BoneInfo = {
  1384. ['ValveBiped.Bip01_L_UpperArm'] = {
  1385. },
  1386. ['ValveBiped.Bip01_R_Hand'] = {
  1387. },
  1388. ['ValveBiped.Bip01_R_Clavicle'] = {
  1389. },
  1390. ['ValveBiped.Bip01_R_UpperArm'] = {
  1391. },
  1392. ['ValveBiped.Bip01_R_Forearm'] = {
  1393. }
  1394. },
  1395. FrameRate = 8
  1396. },
  1397. {
  1398. BoneInfo = {
  1399. ['ValveBiped.Bip01_L_UpperArm'] = {
  1400. RF = -48
  1401. },
  1402. ['ValveBiped.Bip01_R_Forearm'] = {
  1403. RU = 64,
  1404. RR = -32
  1405. },
  1406. ['ValveBiped.Bip01_R_Clavicle'] = {
  1407. },
  1408. ['ValveBiped.Bip01_R_UpperArm'] = {
  1409. RU = -16,
  1410. RF = -32
  1411. },
  1412. ['ValveBiped.Bip01_R_Hand'] = {
  1413. RR = -48,
  1414. RF = -48
  1415. }
  1416. },
  1417. FrameRate = 8
  1418. },
  1419. {
  1420. BoneInfo = {
  1421. ['ValveBiped.Bip01_L_UpperArm'] = {
  1422. RF = -48
  1423. },
  1424. ['ValveBiped.Bip01_R_Hand'] = {
  1425. RU = -32,
  1426. RF = -48
  1427. },
  1428. ['ValveBiped.Bip01_R_Clavicle'] = {
  1429. RU = 16
  1430. },
  1431. ['ValveBiped.Bip01_R_UpperArm'] = {
  1432. RR = 80
  1433. },
  1434. ['ValveBiped.Bip01_R_Forearm'] = {
  1435. }
  1436. },
  1437. FrameRate = 3
  1438. },
  1439. {
  1440. BoneInfo = {
  1441. ['ValveBiped.Bip01_L_UpperArm'] = {
  1442. },
  1443. ['ValveBiped.Bip01_R_Hand'] = {
  1444. },
  1445. ['ValveBiped.Bip01_R_Clavicle'] = {
  1446. },
  1447. ['ValveBiped.Bip01_R_UpperArm'] = {
  1448. },
  1449. ['ValveBiped.Bip01_R_Forearm'] = {
  1450. }
  1451. },
  1452. FrameRate = 5
  1453. }
  1454. },
  1455. Type = TYPE_GESTURE
  1456. })
  1457.  
  1458. RegisterLuaAnimation('sword_attack2_noshield', {
  1459. FrameData = {
  1460. {
  1461. BoneInfo = {
  1462. ['ValveBiped.Bip01_R_Hand'] = {
  1463. },
  1464. ['ValveBiped.Bip01_R_Clavicle'] = {
  1465. },
  1466. ['ValveBiped.Bip01_R_UpperArm'] = {
  1467. },
  1468. ['ValveBiped.Bip01_R_Forearm'] = {
  1469. }
  1470. },
  1471. FrameRate = 8
  1472. },
  1473. {
  1474. BoneInfo = {
  1475. ['ValveBiped.Bip01_R_Forearm'] = {
  1476. RU = 64,
  1477. RR = -32
  1478. },
  1479. ['ValveBiped.Bip01_R_Clavicle'] = {
  1480. },
  1481. ['ValveBiped.Bip01_R_UpperArm'] = {
  1482. RU = -16,
  1483. RF = -32
  1484. },
  1485. ['ValveBiped.Bip01_R_Hand'] = {
  1486. RR = -48,
  1487. RF = -48
  1488. }
  1489. },
  1490. FrameRate = 8
  1491. },
  1492. {
  1493. BoneInfo = {
  1494. ['ValveBiped.Bip01_R_Hand'] = {
  1495. RU = -32,
  1496. RF = -48
  1497. },
  1498. ['ValveBiped.Bip01_R_Clavicle'] = {
  1499. RU = 16
  1500. },
  1501. ['ValveBiped.Bip01_R_UpperArm'] = {
  1502. RR = 80
  1503. },
  1504. ['ValveBiped.Bip01_R_Forearm'] = {
  1505. }
  1506. },
  1507. FrameRate = 3
  1508. },
  1509. {
  1510. BoneInfo = {
  1511. ['ValveBiped.Bip01_R_Hand'] = {
  1512. },
  1513. ['ValveBiped.Bip01_R_Clavicle'] = {
  1514. },
  1515. ['ValveBiped.Bip01_R_UpperArm'] = {
  1516. },
  1517. ['ValveBiped.Bip01_R_Forearm'] = {
  1518. }
  1519. },
  1520. FrameRate = 5
  1521. }
  1522. },
  1523. Type = TYPE_GESTURE
  1524. })
  1525.  
  1526. RegisterLuaAnimation('sword_godefend', {
  1527. FrameData = {
  1528. {
  1529. BoneInfo = {
  1530. ['ValveBiped.Bip01_L_UpperArm'] = {
  1531. },
  1532. ['ValveBiped.Bip01_L_Forearm'] = {
  1533. },
  1534. ['ValveBiped.Bip01_R_Forearm'] = {
  1535. }
  1536. },
  1537. FrameRate = 10
  1538. },
  1539. {
  1540. BoneInfo = {
  1541. ['ValveBiped.Bip01_L_UpperArm'] = {
  1542. RU = -16,
  1543. RR = -16,
  1544. RF = -16
  1545. },
  1546. ['ValveBiped.Bip01_L_Forearm'] = {
  1547. RU = -16,
  1548. RR = 48,
  1549. RF = -32
  1550. },
  1551. ['ValveBiped.Bip01_R_Forearm'] = {
  1552. RU = 32
  1553. },
  1554. ['ValveBiped.Bip01_L_Hand'] = {
  1555. RU = -32
  1556. },
  1557.  
  1558. },
  1559. FrameRate = 4
  1560. },
  1561. {
  1562. BoneInfo = {
  1563. ['ValveBiped.Bip01_L_UpperArm'] = {
  1564. RU = -16,
  1565. RR = -16,
  1566. RF = -16
  1567. },
  1568. ['ValveBiped.Bip01_L_Forearm'] = {
  1569. RU = -16,
  1570. RR = 48,
  1571. RF = -32
  1572. },
  1573. ['ValveBiped.Bip01_R_Forearm'] = {
  1574. RU = 32
  1575. },
  1576. ['ValveBiped.Bip01_L_Hand'] = {
  1577. RU = -32
  1578. },
  1579. },
  1580. FrameRate = 0
  1581. }
  1582. },
  1583. Type = TYPE_STANCE
  1584. })
  1585.  
  1586. RegisterLuaAnimation('sword_leavedefend', {
  1587. FrameData = {
  1588. {
  1589. BoneInfo = {
  1590. ['ValveBiped.Bip01_L_UpperArm'] = {
  1591. RU = -16,
  1592. RR = -16,
  1593. RF = -16
  1594. },
  1595. ['ValveBiped.Bip01_L_Forearm'] = {
  1596. RU = -16,
  1597. RR = 48,
  1598. RF = -32
  1599. },
  1600. ['ValveBiped.Bip01_R_Forearm'] = {
  1601. RU = 32
  1602. },
  1603. ['ValveBiped.Bip01_L_Hand'] = {
  1604. RU = -32
  1605. },
  1606. },
  1607. FrameRate = 10
  1608. },
  1609. {
  1610. BoneInfo = {
  1611. ['ValveBiped.Bip01_L_UpperArm'] = {
  1612. },
  1613. ['ValveBiped.Bip01_L_Forearm'] = {
  1614. },
  1615. ['ValveBiped.Bip01_R_Forearm'] = {
  1616. }
  1617. },
  1618. FrameRate = 4
  1619. }
  1620. },
  1621. Type = TYPE_GESTURE
  1622. })
  1623.  
  1624. RegisterLuaAnimation('sword_parry', {
  1625. FrameData = {
  1626. {
  1627. BoneInfo = {
  1628. ['ValveBiped.Bip01_R_UpperArm'] = {
  1629. },
  1630. ['ValveBiped.Bip01_L_UpperArm'] = {
  1631. },
  1632. ['ValveBiped.Bip01_L_Forearm'] = {
  1633. }
  1634. },
  1635. FrameRate = 7
  1636. },
  1637. {
  1638. BoneInfo = {
  1639. ['ValveBiped.Bip01_R_UpperArm'] = {
  1640. RU = 32
  1641. },
  1642. ['ValveBiped.Bip01_L_UpperArm'] = {
  1643. },
  1644. ['ValveBiped.Bip01_L_Forearm'] = {
  1645. RR = 32,
  1646. RF = 32
  1647. }
  1648. },
  1649. FrameRate = 7
  1650. },
  1651. {
  1652. BoneInfo = {
  1653. ['ValveBiped.Bip01_R_UpperArm'] = {
  1654. RU = 32
  1655. },
  1656. ['ValveBiped.Bip01_L_UpperArm'] = {
  1657. RU = -32,
  1658. RF = -32
  1659. },
  1660. ['ValveBiped.Bip01_L_Forearm'] = {
  1661. RF = 32
  1662. }
  1663. },
  1664. FrameRate = 5
  1665. },
  1666. {
  1667. BoneInfo = {
  1668. ['ValveBiped.Bip01_R_UpperArm'] = {
  1669. RU = 32
  1670. },
  1671. ['ValveBiped.Bip01_L_UpperArm'] = {
  1672. RU = -32,
  1673. RF = -32
  1674. },
  1675. ['ValveBiped.Bip01_L_Forearm'] = {
  1676. RF = 32
  1677. }
  1678. },
  1679. FrameRate = 10
  1680. },
  1681. {
  1682. BoneInfo = {
  1683. ['ValveBiped.Bip01_R_UpperArm'] = {
  1684. },
  1685. ['ValveBiped.Bip01_L_UpperArm'] = {
  1686. },
  1687. ['ValveBiped.Bip01_L_Forearm'] = {
  1688. }
  1689. },
  1690. FrameRate = 3
  1691. }
  1692. },
  1693. Type = TYPE_GESTURE
  1694. })
  1695.  
  1696. RegisterLuaAnimation('sword_attackstab', {
  1697. FrameData = {
  1698. {
  1699. BoneInfo = {
  1700. ['ValveBiped.Bip01_R_UpperArm'] = {
  1701. },
  1702. ['ValveBiped.Bip01_R_Forearm'] = {
  1703. },
  1704. ['ValveBiped.Bip01_L_UpperArm'] = {
  1705. },
  1706. ['ValveBiped.Bip01_R_Hand'] = {
  1707. }
  1708. },
  1709. FrameRate = 10
  1710. },
  1711. {
  1712. BoneInfo = {
  1713. ['ValveBiped.Bip01_R_UpperArm'] = {
  1714. RU = 112
  1715. },
  1716. ['ValveBiped.Bip01_R_Forearm'] = {
  1717. },
  1718. ['ValveBiped.Bip01_L_UpperArm'] = {
  1719. RF = -48
  1720. },
  1721. ['ValveBiped.Bip01_R_Hand'] = {
  1722. }
  1723. },
  1724. FrameRate = 5
  1725. },
  1726. {
  1727. BoneInfo = {
  1728. ['ValveBiped.Bip01_L_UpperArm'] = {
  1729. RF = -48
  1730. },
  1731. ['ValveBiped.Bip01_R_Forearm'] = {
  1732. RU = 64
  1733. },
  1734. ['ValveBiped.Bip01_R_UpperArm'] = {
  1735. RU = -48,
  1736. RF = -32
  1737. },
  1738. ['ValveBiped.Bip01_R_Hand'] = {
  1739. RR = -64
  1740. }
  1741. },
  1742. FrameRate = 5
  1743. },
  1744. {
  1745. BoneInfo = {
  1746. ['ValveBiped.Bip01_R_UpperArm'] = {
  1747. },
  1748. ['ValveBiped.Bip01_R_Forearm'] = {
  1749. },
  1750. ['ValveBiped.Bip01_L_UpperArm'] = {
  1751. },
  1752. ['ValveBiped.Bip01_R_Hand'] = {
  1753. }
  1754. },
  1755. FrameRate = 5
  1756. }
  1757. },
  1758. Type = TYPE_GESTURE
  1759. })
  1760.  
  1761. RegisterLuaAnimation('sword_attackstab_noshield', {
  1762. FrameData = {
  1763. {
  1764. BoneInfo = {
  1765. ['ValveBiped.Bip01_R_UpperArm'] = {
  1766. },
  1767. ['ValveBiped.Bip01_R_Forearm'] = {
  1768. },
  1769. ['ValveBiped.Bip01_R_Hand'] = {
  1770. }
  1771. },
  1772. FrameRate = 10
  1773. },
  1774. {
  1775. BoneInfo = {
  1776. ['ValveBiped.Bip01_R_UpperArm'] = {
  1777. RU = 112
  1778. },
  1779. ['ValveBiped.Bip01_R_Hand'] = {
  1780. }
  1781. },
  1782. FrameRate = 5
  1783. },
  1784. {
  1785. BoneInfo = {
  1786. ['ValveBiped.Bip01_R_Forearm'] = {
  1787. RU = 64
  1788. },
  1789. ['ValveBiped.Bip01_R_UpperArm'] = {
  1790. RU = -48,
  1791. RF = -32
  1792. },
  1793. ['ValveBiped.Bip01_R_Hand'] = {
  1794. RR = -64
  1795. }
  1796. },
  1797. FrameRate = 5
  1798. },
  1799. {
  1800. BoneInfo = {
  1801. ['ValveBiped.Bip01_R_UpperArm'] = {
  1802. },
  1803. ['ValveBiped.Bip01_R_Forearm'] = {
  1804. },
  1805. ['ValveBiped.Bip01_R_Hand'] = {
  1806. }
  1807. },
  1808. FrameRate = 5
  1809. }
  1810. },
  1811. Type = TYPE_GESTURE
  1812. })
  1813.  
  1814. RegisterLuaAnimation('sword_stunned', {
  1815. FrameData = {
  1816. {
  1817. BoneInfo = {
  1818. ['ValveBiped.Bip01_R_UpperArm'] = {
  1819. RU = -48
  1820. },
  1821. ['ValveBiped.Bip01_L_UpperArm'] = {
  1822. RF = -48
  1823. },
  1824. ['ValveBiped.Bip01_R_Forearm'] = {
  1825. }
  1826. },
  1827. FrameRate = 7
  1828. },
  1829. {
  1830. BoneInfo = {
  1831. ['ValveBiped.Bip01_R_UpperArm'] = {
  1832. RR = 48
  1833. },
  1834. ['ValveBiped.Bip01_L_UpperArm'] = {
  1835. RR = -80
  1836. },
  1837. ['ValveBiped.Bip01_L_Forearm'] = {
  1838. RU = 64
  1839. }
  1840. },
  1841. FrameRate = 4
  1842. },
  1843. {
  1844. BoneInfo = {
  1845. ['ValveBiped.Bip01_R_UpperArm'] = {
  1846. RR = 48
  1847. },
  1848. ['ValveBiped.Bip01_L_UpperArm'] = {
  1849. RR = -80
  1850. },
  1851. ['ValveBiped.Bip01_L_Forearm'] = {
  1852. RU = 64
  1853. }
  1854. },
  1855. FrameRate = 2
  1856. },
  1857. {
  1858. BoneInfo = {
  1859. ['ValveBiped.Bip01_R_UpperArm'] = {
  1860. },
  1861. ['ValveBiped.Bip01_L_UpperArm'] = {
  1862. },
  1863. ['ValveBiped.Bip01_L_Forearm'] = {
  1864. }
  1865. },
  1866. FrameRate = 2
  1867. }
  1868. },
  1869. Type = TYPE_GESTURE
  1870. })
  1871.  
  1872. RegisterLuaAnimation('sword_break', {
  1873. FrameData = {
  1874. {
  1875. BoneInfo = {
  1876. ['ValveBiped.Bip01_R_UpperArm'] = {
  1877. },
  1878. ['ValveBiped.Bip01_L_Forearm'] = {
  1879. },
  1880. ['ValveBiped.Bip01_L_UpperArm'] = {
  1881. },
  1882. ['ValveBiped.Bip01_R_Forearm'] = {
  1883. }
  1884. },
  1885. FrameRate = 7
  1886. },
  1887. {
  1888. BoneInfo = {
  1889. ['ValveBiped.Bip01_R_UpperArm'] = {
  1890. RU = -64,
  1891. RF = -80
  1892. },
  1893. ['ValveBiped.Bip01_L_Forearm'] = {
  1894. RU = 48
  1895. },
  1896. ['ValveBiped.Bip01_L_UpperArm'] = {
  1897. },
  1898. ['ValveBiped.Bip01_R_Forearm'] = {
  1899. RU = 32
  1900. }
  1901. },
  1902. FrameRate = 7
  1903. },
  1904. {
  1905. BoneInfo = {
  1906. ['ValveBiped.Bip01_R_UpperArm'] = {
  1907. RU = -64,
  1908. RR = 96,
  1909. RF = -80
  1910. },
  1911. ['ValveBiped.Bip01_R_Forearm'] = {
  1912. },
  1913. ['ValveBiped.Bip01_L_UpperArm'] = {
  1914. },
  1915. ['ValveBiped.Bip01_L_Forearm'] = {
  1916. RU = 48
  1917. }
  1918. },
  1919. FrameRate = 5
  1920. },
  1921. {
  1922. BoneInfo = {
  1923. ['ValveBiped.Bip01_R_UpperArm'] = {
  1924. },
  1925. ['ValveBiped.Bip01_L_Forearm'] = {
  1926. },
  1927. ['ValveBiped.Bip01_L_UpperArm'] = {
  1928. },
  1929. ['ValveBiped.Bip01_R_Forearm'] = {
  1930. }
  1931. },
  1932. FrameRate = 3
  1933. }
  1934. },
  1935. Type = TYPE_GESTURE
  1936. })
  1937.  
  1938. RegisterLuaAnimation('sword_break_noshield', {
  1939. FrameData = {
  1940. {
  1941. BoneInfo = {
  1942. ['ValveBiped.Bip01_R_UpperArm'] = {
  1943. },
  1944. ['ValveBiped.Bip01_R_Forearm'] = {
  1945. }
  1946. },
  1947. FrameRate = 7
  1948. },
  1949. {
  1950. BoneInfo = {
  1951. ['ValveBiped.Bip01_R_UpperArm'] = {
  1952. RU = -64,
  1953. RF = -80
  1954. },
  1955. ['ValveBiped.Bip01_R_Forearm'] = {
  1956. RU = 32
  1957. }
  1958. },
  1959. FrameRate = 7
  1960. },
  1961. {
  1962. BoneInfo = {
  1963. ['ValveBiped.Bip01_R_UpperArm'] = {
  1964. RU = -64,
  1965. RR = 96,
  1966. RF = -80
  1967. },
  1968. ['ValveBiped.Bip01_R_Forearm'] = {
  1969. }
  1970. },
  1971. FrameRate = 5
  1972. },
  1973. {
  1974. BoneInfo = {
  1975. ['ValveBiped.Bip01_R_UpperArm'] = {
  1976. },
  1977. ['ValveBiped.Bip01_R_Forearm'] = {
  1978. }
  1979. },
  1980. FrameRate = 3
  1981. }
  1982. },
  1983. Type = TYPE_GESTURE
  1984. })
  1985.  
  1986. -- Dumbledore kills Snape
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement