Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- To Do
- - Better Sounds
- */
- -- Heyo, welcome to this lua file
- -- if you're using this to learn, feel free to snoop around and ask buu342@hotmail.com or buu342 on steam for help
- -- If you're using this to steal, be nice to me :(
- -- If you're using this as the code for your world destruction machine, make sure Portugal isn't destroyed. I like it there
- -- If your reason hasn't been stated above, sorry I ignored you D:
- -- Whatever it is, have fun looking around
- -- Note to self: Stop writing as if someone is going to read this. No one really cares
- -- But if you're this far, then you do. Love you <33
- if (SERVER) then
- AddCSLuaFile("weapon_ds_base.lua")
- end
- -- Swooshy and Pachingy sounds
- local soundData = {
- name = "Weapon_CBroad.Draw" ,
- channel = CHAN_ITEM,
- volume = 0.5,
- soundlevel = 80,
- pitchstart = 100,
- pitchend = 100,
- sound = "weapons/DarkSouls/Sheath.wav"
- }
- sound.Add(soundData)
- local soundData = {
- name = "Weapon_CBroad.Holster" ,
- channel = CHAN_ITEM,
- volume = 0.5,
- soundlevel = 80,
- pitchstart = 100,
- pitchend = 100,
- sound = "weapons/DarkSouls/Holster.wav"
- }
- sound.Add(soundData)
- local soundData = {
- name = "Weapon_CBroad.Parry" ,
- channel = CHAN_ITEM,
- volume = 0.5,
- soundlevel = 80,
- pitchstart = 100,
- pitchend = 100,
- sound = "weapons/DarkSouls/Parry.wav"
- }
- sound.Add(soundData)
- -- Precaching stuff
- util.PrecacheModel("models/weapons/c_ds_SSAS.mdl")
- util.PrecacheModel("models/weapons/w_ds_shieldhitbox.mdl")
- util.PrecacheSound("weapons/DarkSouls/block.wav")
- util.PrecacheSound("weapons/DarkSouls/Holster.wav")
- util.PrecacheSound("weapons/DarkSouls/Parry.wav")
- util.PrecacheSound("weapons/DarkSouls/Parry_Sucess.wav")
- util.PrecacheSound("weapons/DarkSouls/Sheath.wav")
- util.PrecacheSound("weapons/DarkSouls/Swing_HitFlesh.wav")
- util.PrecacheSound("weapons/DarkSouls/Swing_HitPowerful.wav")
- util.PrecacheSound("weapons/DarkSouls/Swing_HitStuff.wav")
- util.PrecacheSound("weapons/DarkSouls/Swing_HitWorld.wav")
- util.PrecacheSound("weapons/DarkSouls/Swing1.wav")
- util.PrecacheSound("weapons/DarkSouls/Swing2.wav")
- util.PrecacheSound("weapons/DarkSouls/Swing3.wav")
- -- Screen stuff
- if (CLIENT) then
- SWEP.DrawAmmo = false
- SWEP.DrawCrosshair = false
- SWEP.ViewModelFOV = 50
- end
- SWEP.Base = "weapon_base"
- if CLIENT then
- SWEP.PrintName = "Broadsword"
- SWEP.Author = "Buu342"
- SWEP.Slot = 0
- SWEP.SlotPos = 0
- SWEP.IconLetter = "j"
- SWEP.Icon = surface.GetTextureID("VGUI/entities/weapon_ds_broadsword")
- SWEP.KillIcon = "VGUI/entities/weapon_ds_broadsword"
- killicon.Add("weapon_ds_broadsword",SWEP.KillIcon,Color(255,255,255))
- SWEP.WepSelectIcon = SWEP.Icon
- end
- -- Your normal SWEP content.
- SWEP.Category = "Dark Souls"
- SWEP.ViewModelFlip = false
- SWEP.HoldType = "duel"
- SWEP.UseHands = true
- SWEP.BobScale = 1
- SWEP.ViewModel = "models/weapons/c_ds_SSAS.mdl"
- SWEP.WorldModel = "models/weapons/w_bs_broadsword.mdl"
- SWEP.Spawnable = false -- Let's NOT spawn the base, because otherwise some things won't work (such as parrying)
- SWEP.AdminSpawnable = true
- SWEP.Primary.Sound1 = "weapons/DarkSouls/Swing1.wav"
- SWEP.Primary.Sound2 = "weapons/DarkSouls/Swing2.wav"
- SWEP.Primary.Sound3 = "weapons/DarkSouls/Swing3.wav"
- SWEP.Primary.Damage = 10
- SWEP.Primary.ClipSize = -1
- SWEP.Primary.DefaultClip = 1
- SWEP.Primary.Automatic = false
- SWEP.Primary.Ammo = "none"
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = false
- SWEP.Secondary.Ammo = "none"
- -- New Variables
- SWEP.ModelGroup = 0 --Which bodygroup to use for the sword? (This is to keep download speed and file amount to a minimum)
- SWEP.ShieldGroup = 0 --Don't Touch this. It's related to the shield model.
- SWEP.SwingSpeed = 1 --How quickly the animations play in percentage. 1 = normal; 0.5 = half speed; 2 = double speed; etc...
- SWEP.CrouchPos = Vector(-1,-1,.5) --Makes viewmodel move back when crouching for """""Immersion"""""
- SWEP.Reach = 95
- -- Set up variables for prediction
- function SWEP:SetupDataTables()
- self:NetworkVar("Int",0,"Sword_AttackType") --Handles swinging animation
- self:NetworkVar("Int",1,"Shield_Model") --Handles shield model
- self:NetworkVar("Float",0,"Sword_FakeTimer1") --Sets CanAttack to true for followup attack
- self:NetworkVar("Float",1,"Sword_FakeTimer2") --Sets CanAttack to false after failing followup attack
- self:NetworkVar("Float",2,"Sword_FakeTimer3") --Sets CanAttack to true after failing followup attack and waiting for the animation to end
- self:NetworkVar("Float",3,"Sword_FakeTimer4") --Handles Idle Animation On Deploy and other stuff
- self:NetworkVar("Float",4,"Sword_AttackingTimer") --Handles sounds and ability to get parried
- self:NetworkVar("Float",5,"Shield_FakeTimer1") --Handles Blocking Animation in
- self:NetworkVar("Float",6,"Shield_FakeTimer2") --Handles Blocking Animation out
- self:NetworkVar("Float",7,"Shield_FakeTimer3") --Handles Parrying
- self:NetworkVar("Float",8,"Sword_Stunned") --Handles Stunning
- self:NetworkVar("Float",9,"FakeTimerShoot") --Handles the time between the player clicking and the "bullet" firing
- self:NetworkVar("Float",10,"FakeTimerShoot2") --Prediction
- self:NetworkVar("Float",11,"FakeTimerShoot3") --GuardBreak
- self:NetworkVar("Bool",0,"Sword_CanAttack") --Boy I wonder what this does???
- self:NetworkVar("Bool",1,"Shield_Canblock") --This Too???
- self:NetworkVar("Bool",2,"Shield_Blocking") --I'm gonna stop now, I'm a bit tired of thinking of witty remarks to write here
- self:NetworkVar("Bool",4,"Sword_Attacking") --Yep, gonna totally stop them
- self:NetworkVar("Bool",5,"Shield_Parrying") --Mmhmm
- self:NetworkVar("Bool",6,"Sword_Breaking") --I'm running out of retorts
- self:NetworkVar("Bool",7,"Sword_TPIdle")
- self:NetworkVar("Bool",8,"Sword_AlreadyAttacking") --Stabbing stuff
- end
- --Pitas Contributions
- function SWEP:Equip()
- self.Primary.Damage = self.Primary.Damage + (CRAFTINGMOD.User[self.Owner:SteamID()].Levels.Stats.Strength.curLevel * 10)
- --print(self.PrintName .. " damage",self.Primary.Damage)
- self.SwingSpeed = self.SwingSpeed + (CRAFTINGMOD.User[self.Owner:SteamID()].Levels.Stats.Dexterity.curLevel * 0.05)
- --print(self.PrintName .. " swing speed",self.SwingSpeed)
- end
- function SWEP:Think()
- -- First comes worlmodel positioning
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1"), Angle(-10,-40,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11"), Angle(0,-65,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1"), Angle(-10,-20,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11"), Angle(0,-35,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Hand") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Hand"), Angle(0,-30,0) )
- end
- if self:GetShield_Model() == 0 then
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(20,40,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,50,0) )
- end
- elseif self.Owner:GetNWInt("BuuSwords_ResetBonesSheild") == true then
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- self.Owner:SetNWInt("BuuSwords_ResetBonesSheild",false)
- end
- self.Owner:GetViewModel():SetPlaybackRate(self.SwingSpeed)
- -- Next comes blocking code
- if self:GetShield_Model() != 0 && !self.Owner:KeyDown(IN_USE) && self.Owner:KeyPressed(IN_ATTACK2) && self:GetShield_Canblock() == true then
- self:SetShield_Canblock(false)
- self:SetSword_CanAttack(false)
- self.Owner:ResetLuaAnimation("sword_godefend")
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "idle_to_blocked" ))
- self:SetShield_FakeTimer1(CurTime() + (self.Owner:GetViewModel():SequenceDuration() * (1/self.SwingSpeed)))
- end
- if self:GetShield_Model() != 0 && !self.Owner:KeyDown(IN_ATTACK2) && self:GetShield_Blocking() == true then
- self:SetShield_Blocking(false)
- self.Owner:ResetLuaAnimation("sword_leavedefend")
- self.Owner:StopLuaAnimation("sword_godefend")
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "blocked_to_idle" ))
- self:SetShield_FakeTimer2(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- if SERVER then
- if(self.Shield and self.Shield:IsValid()) then
- self.Shield:Remove()
- return true
- end
- end
- end
- if SERVER then
- if self:GetShield_Blocking() == false && IsValid(self.Shield) then
- self.Shield:Remove()
- end
- end
- if SERVER then --Position our shield with the player
- if(self.Shield and self.Shield:IsValid()) then
- local Offset = Vector(16,-5,0)
- if(self.Owner:Crouching()) then
- Offset.z = Offset.z - 0
- Offset.x = Offset.x + 0
- end
- local Pos, Ang = LocalToWorld(Offset,Angle(5,0,0),self.Owner:GetPos(),Angle(0,self.Owner:GetAngles().y,0))
- self.Shield:SetAngles(Ang)
- self.Shield:SetPos(Pos)
- end
- end
- -- Now comes Parrying
- if self:GetShield_Model() != 0 && !self.Owner:KeyDown(IN_USE) && self.Owner:KeyPressed(IN_RELOAD) && self:GetShield_Canblock() == true then
- self:SetShield_Canblock(false)
- self:SetSword_CanAttack(false)
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "parry" ))
- self.Owner:ResetLuaAnimation("sword_parry")
- self:SetSword_FakeTimer4(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- self:SetShield_Parrying(true)
- self:SetShield_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()*0.3* (1/self.SwingSpeed))
- end
- -- Guard breaking is now
- if self.Owner:KeyDown(IN_USE) && self.Owner:KeyPressed(IN_RELOAD) && self:GetShield_Canblock() == true then
- self:SetShield_Canblock(false)
- self:SetSword_CanAttack(false)
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "Attack_Break" ))
- self:SetFakeTimerShoot3(CurTime() + self.Owner:GetViewModel():SequenceDuration()*0.2* (1/self.SwingSpeed))
- if self:GetShield_Model() != 0 then
- self.Owner:ResetLuaAnimation("sword_break")
- else
- self.Owner:ResetLuaAnimation("sword_break_noshield")
- end
- self:SetSword_FakeTimer4(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- self:SetShield_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()*0.3* (1/self.SwingSpeed))
- end
- -- Timers, yay!!! Had to make my own so this base would be fully predicted
- -- Decided to organize it like this for reading's sake
- self:IdleStuff_Timer1()
- self:StunStuff_Timer1()
- self:ParryStuff_Timer1()
- self:AttackStuff_Damage()
- self:AttackStuff_DamageParry()
- self:AttackStuff_DamageBreak()
- self:AttackStuff_Timer1()
- self:AttackStuff_Timer2()
- self:AttackStuff_Timer3()
- self:AttackStuff_Timer4()
- self:AttackStuff_Timer5()
- self:DefendStuff_Timer1()
- self:DefendStuff_Timer2()
- -- Since I wanted fancy holster animations, had to make some code which sets the weapon to holster to
- if self.Owner:GetNWBool("Holstered") == true then
- if (CLIENT or game.SinglePlayer()) && IsValid(self.Weapon) && IsValid(self.Owner) then
- self:SetSword_TPIdle(false)
- self:Holster()
- if IsValid(self.Owner) && self.Owner:GetNWEntity("WeaponToHolsterTo"):GetClass() != nil then
- self.Owner:ConCommand("use "..self.Owner:GetNWEntity("WeaponToHolsterTo"):GetClass())
- end
- end
- end
- self:SetShield_Model(self.Owner:GetNWInt("BuuSwords_CurrentShield",0))
- self.Owner:GetViewModel():SetBodygroup(2,self.Owner:GetNWInt("BuuSwords_CurrentShield",0))
- --Amazing Chest Ahead
- end
- -- Shwing
- function SWEP:Deploy()
- self:SetSword_TPIdle(false)
- self.Owner:GetViewModel():SetBodygroup(1,self.ModelGroup)
- self.Owner:GetViewModel():SetBodygroup(2,self:GetShield_Model())
- self.Owner:SetNWEntity("WeaponToHolsterTo",nil)
- self.Owner:SetNWBool("Holstered",false)
- self:SetShield_Canblock(false)
- self:SetSword_AttackType(0)
- self:SetSword_CanAttack(false)
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "draw" ) )
- self.Weapon:SetNextPrimaryFire( CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) )
- self:SetSword_FakeTimer4(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- if self:GetShield_Model() != 0 then
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- else
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(20,40,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,50,0) )
- end
- end
- return true
- end
- function SWEP:OnRemove()
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Hand") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Hand"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- if SERVER then
- if(self.Shield and self.Shield:IsValid()) then
- self.Shield:Remove()
- return true
- end
- end
- end
- -- Putting the sword back in it's sheath
- function SWEP:Holster(weapon)
- if self.Owner:GetNWBool("Holstered") == true then
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Hand") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Hand"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(0,0,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,0,0) )
- end
- return true
- end
- self.Owner:Freeze(false)
- if SERVER && !self.Owner:KeyDown(IN_ATTACK2) then
- if(self.Shield and self.Shield:IsValid()) then
- self.Shield:Remove()
- end
- end
- if self and self.Weapon and IsValid(self.Weapon) && self:GetShield_Canblock() == true && self:GetSword_CanAttack() == true then
- self:SetShield_Canblock(false)
- self:SetSword_AttackType(0)
- self:SetSword_CanAttack(false)
- if IsValid(self.Owner) && IsValid(self.Owner:GetViewModel()) then
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "holster" ) )
- end
- if self.Owner:GetNWBool("Holstered") == false then
- if !IsValid(self.Weapon) then return end
- timer.Simple(1, function()
- if !IsValid(self.Weapon) then return end
- self.Owner:SetNWEntity("WeaponToHolsterTo",weapon)
- self.Owner:SetNWBool("Holstered",true)
- end)
- end
- end
- end
- -- Garry's Mod should do this automatically ._.
- function SWEP:Initialize()
- self:SetHoldType(self.HoldType)
- self:SetShield_Model(self.Owner:GetNWInt("BuuSwords_StartingShield",0))
- end
- -- Real men code their own SecondaryAttack in SWEP:Think()
- -- Except when that stuff is related to Derma
- -- KeyPressed should only check WHEN THE KEY IS PRESSED BUT NOOOOOO. THAT WOULD BE TOO LOGICAL.
- function SWEP:SecondaryAttack()
- -- Shield Menu Stuff
- if self.Owner:KeyDown(IN_USE) then
- if !game.SinglePlayer() then
- if CLIENT then
- if LocalPlayer():GetNWInt("BuuSwords_testblocking",0) == 1 then return end
- LocalPlayer():SetNWInt("BuuSwords_testblocking",1)
- local Width = 656
- local Height = 122
- local Frame = vgui.Create( "DFrame" )
- Frame:SetPos( (ScrW()/2)-(Width/2), (ScrH()/2 )-(Height/2))
- Frame:SetSize( Width, Height )
- Frame:SetTitle( "Shield Selection" )
- Frame:SetVisible( true )
- Frame:SetDraggable( false )
- Frame:ShowCloseButton( true )
- Frame:MakePopup()
- function Frame:OnClose()
- LocalPlayer():SetNWInt("BuuSwords_testblocking",0)
- end
- Frame.Paint = function()
- draw.RoundedBox( 2, 0, 0, Frame:GetWide(), Frame:GetTall(), Color( 0, 0, 0, 150 ) )
- end
- local model = "models/weapons/w_bs_broadsword.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 16, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",0)
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 0, 8 )
- net.SendToServer()
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Bouche") == true then
- local model = "models/weapons/w_bs_shield_bouche.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 96, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",1)
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 1, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Buckler") == true then
- local model = "models/weapons/w_bs_shield_Buckler.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 176, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",2)
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 2, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Crest") == true then
- local model = "models/weapons/w_bs_shield_Crest.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 256, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",3)
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 3, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Heater") == true then
- local model = "models/weapons/w_bs_shield_Heater.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 336, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",4)
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 4, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Kite") == true then
- local model = "models/weapons/w_bs_shield_Kite.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 416, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",5)
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 5, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Scutum") == true then
- local model = "models/weapons/w_bs_shield_Scutum.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 496, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",6)
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 6, 8 )
- net.SendToServer()
- end
- end
- if LocalPlayer():GetNWBool( "BuuSwords_Has_Targe") == true then
- local model = "models/weapons/w_bs_shield_targe.mdl"
- BGPanel = vgui.Create( "DPanel",Frame )
- BGPanel:SetPos( 576, 40 )
- BGPanel:SetSize( 64, 64 )
- local mdl = vgui.Create( "SpawnIcon", BGPanel )
- mdl:SetSize( BGPanel:GetSize() )
- mdl:SetModel( model )
- function mdl:DoClick()
- LocalPlayer():SetNWInt("BuuSwords_CurrentShield",7)
- net.Start( "ChangeShieldBuu" )
- net.WriteUInt( 7, 8 )
- net.SendToServer()
- end
- end
- end
- else
- self.Owner:ConCommand("Buu_ShieldMenu")
- end
- end
- end
- --Frontstab? stuff
- function SWEP:EntsInSphereFront( pos, range )
- local ents = ents.FindInSphere(pos,range)
- for k, v in pairs(ents) do
- if v != self and v != self.Owner and (v:IsNPC() or v:IsPlayer()) and IsValid(v) and self:EntityFaceFront(v) then
- return true
- end
- end
- return false
- end
- function SWEP:EntityFaceFront(ent)
- local angle = self.Owner:GetAngles().y -ent:GetAngles().y
- if angle < -180 then angle = 360 +angle end
- if angle <= 90 and angle >= -90 then return false end
- return true
- end
- function SWEP:CheckFrontStab()
- local tr = {}
- tr.start = self.Owner:GetShootPos()
- tr.endpos = self.Owner:GetShootPos() + ( self.Owner:GetAimVector() * self.Reach )
- tr.filter = self.Owner
- tr.mask = MASK_SHOT
- local trace = util.TraceLine( tr )
- local pos = self.Owner:GetShootPos()
- local ang = self.Owner:GetAimVector()
- local tracedata = {}
- tracedata.start = pos
- tracedata.endpos = pos +(self.Owner:GetAimVector( ) *66)
- tracedata.filter = self.Owner
- local tr = util.TraceLine(tracedata)
- 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
- return true
- else
- return false
- end
- end
- -- Does the killing
- function SWEP:PrimaryAttack()
- --Be wary of Tears
- if self:GetSword_CanAttack() == false then return end
- self:SetSword_AlreadyAttacking(false)
- self:SetShield_Canblock(false)
- self:SetSword_FakeTimer1(0)
- self:SetSword_FakeTimer2(0)
- self:SetSword_FakeTimer3(0)
- local tr = util.TraceLine( {
- start = self.Owner:GetShootPos(),
- endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
- filter = self.Owner,
- mask = MASK_SHOT_HULL
- } )
- if ( !IsValid( tr.Entity ) ) then
- tr = util.TraceHull( {
- start = self.Owner:GetShootPos(),
- endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
- filter = self.Owner,
- mins = Vector( -10, -10, -8 ),
- maxs = Vector( 10, 10, 8 ),
- mask = MASK_SHOT_HULL
- } )
- end
- -- Note to future self: I'm sorry for below
- if self:GetSword_AttackType() > 2 then
- self:SetSword_AttackType(1)
- end
- if !IsValid(self.Weapon) then return end
- if self:GetSword_AttackType() == 2 then
- 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
- if self:GetShield_Model() != 0 then
- self.Owner:ResetLuaAnimation("sword_attackstab")
- else
- self.Owner:ResetLuaAnimation("sword_attackstab_noshield")
- end
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack_stab" ) )
- self:SetSword_CanAttack(false)
- self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- self:SetSword_AttackType(0)
- if tr.Hit && IsValid( tr.Entity ) && (tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetSword_Stunned() > 0 ) then
- self:SetFakeTimerShoot2(CurTime() + (self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.2))
- end
- else
- self.Owner:ViewPunch( Angle( 2, 2, 0 ) )
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack3" ) )
- if self:GetShield_Model() != 0 then
- self.Owner:ResetLuaAnimation("sword_attack1")
- else
- self.Owner:ResetLuaAnimation("sword_attack1_noshield")
- end
- self:SetSword_AttackType(3)
- self:SetSword_CanAttack(false)
- self:SetSword_AttackingTimer(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.15)
- self.Weapon:SetNextPrimaryFire( CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.5 )
- self:SetSword_FakeTimer1(CurTime() + self.Owner:GetViewModel():SequenceDuration()* ( 1/self.SwingSpeed)*0.5)
- self:SetSword_FakeTimer2(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.7)
- self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- end
- end
- if self:GetSword_AttackType() == 1 then
- 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
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack_stab" ) )
- self:SetSword_CanAttack(false)
- self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- self:SetSword_AttackType(0)
- if self:GetShield_Model() != 0 then
- self.Owner:ResetLuaAnimation("sword_attackstab")
- else
- self.Owner:ResetLuaAnimation("sword_attackstab_noshield")
- end
- self:SetFakeTimerShoot2(CurTime() + (self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.2))
- if tr.Hit && IsValid( tr.Entity ) && (tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetSword_Stunned() > 0 ) then
- self:SetFakeTimerShoot2(CurTime() + (self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.2))
- end
- else
- self.Owner:ViewPunch( Angle( -2, -2, 0 ) )
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack2" ) )
- if self:GetShield_Model() != 0 then
- self.Owner:ResetLuaAnimation("sword_attack2")
- else
- self.Owner:ResetLuaAnimation("sword_attack2_noshield")
- end
- self:SetSword_AttackType(2)
- self:SetSword_CanAttack(false)
- self:SetSword_AttackingTimer(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.15)
- self.Weapon:SetNextPrimaryFire( CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.5 )
- self:SetSword_FakeTimer1(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.5)
- self:SetSword_FakeTimer2(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.7)
- self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- end
- end
- if self:GetSword_AttackType() == 0 then
- self.Owner:ViewPunch( Angle( 2, 2, 0 ) )
- 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
- if self:GetShield_Model() != 0 then
- self.Owner:ResetLuaAnimation("sword_attackstab")
- else
- self.Owner:ResetLuaAnimation("sword_attackstab_noshield")
- end
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack_stab" ) )
- self:SetSword_CanAttack(false)
- self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- self:SetSword_AttackType(0)
- if tr.Hit && IsValid( tr.Entity ) && (tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetSword_Stunned() > 0 ) then
- self:SetFakeTimerShoot2(CurTime() + (self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.2))
- end
- else
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack1" ) )
- if self:GetShield_Model() != 0 then
- self.Owner:ResetLuaAnimation("sword_attack1")
- else
- self.Owner:ResetLuaAnimation("sword_attack1_noshield")
- end
- self:SetSword_AttackType(1)
- self:SetSword_CanAttack(false)
- self.Weapon:SetNextPrimaryFire( CurTime() * self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) *0.4 )
- self:SetSword_AttackingTimer(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.15)
- self:SetSword_FakeTimer1(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.4)
- self:SetSword_FakeTimer2(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed)*0.6)
- self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- end
- end
- self:SetFakeTimerShoot(CurTime() + (self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed) * 0.2))
- end
- -- Makes it look like the player has Parkinson's. Also sets variables and stuff
- function SWEP:GotoIdleAnim()
- self:SetSword_TPIdle(true)
- self:SetSword_AlreadyAttacking(false)
- self:SetShield_Canblock(true)
- self:SetSword_AttackType(0)
- self:SetSword_CanAttack(true)
- self.CanUnblock = true
- if !IsValid(self.Weapon) then return end
- if !IsValid(self.Owner:GetViewModel()) then return end
- self.Owner:GetViewModel():ResetSequence( self.Owner:GetViewModel():LookupSequence( "idle" ) )
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1"), Angle(-10,-40,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11"), Angle(0,-65,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1"), Angle(-10,-20,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11"), Angle(0,-35,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Hand") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Hand"), Angle(0,-30,0) )
- end
- if self:GetShield_Model() == 0 then
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(20,40,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,50,0) )
- end
- end
- end
- -- I put the damage tracing here for readability's sake. However please don't read this because it's not very good.
- function SWEP:AttackStuff_DamageParry()
- if CurTime() > self:GetFakeTimerShoot2() && self:GetFakeTimerShoot2() > 0 then
- self:SetFakeTimerShoot2(0)
- self:SetFakeTimerShoot(0)
- local tr = util.TraceLine( {
- start = self.Owner:GetShootPos(),
- endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
- filter = self.Owner,
- mask = MASK_SHOT_HULL
- } )
- if ( !IsValid( tr.Entity ) ) then
- tr = util.TraceHull( {
- start = self.Owner:GetShootPos(),
- endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
- filter = self.Owner,
- mins = Vector( -10, -10, -8 ),
- maxs = Vector( 10, 10, 8 ),
- mask = MASK_SHOT_HULL
- } )
- end
- if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() || tr.Entity:Health() > 0 ) ) then
- local dmginfo = DamageInfo()
- local attacker = self.Owner
- if ( !IsValid( attacker ) ) then attacker = self end
- dmginfo:SetAttacker( attacker )
- dmginfo:SetInflictor( self )
- dmginfo:SetDamage( self.Primary.Damage*10 )
- dmginfo:SetDamageForce( self.Owner:GetForward() * 10000 )
- if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() || tr.Entity:Health() > 0 ) ) && IsFirstTimePredicted() then
- tr.Entity:TakeDamageInfo( dmginfo )
- end
- end
- if ( SERVER && IsValid( tr.Entity ) ) then
- local phys = tr.Entity:GetPhysicsObject()
- if ( IsValid( phys ) ) then
- phys:ApplyForceOffset( self.Owner:GetAimVector() * self.Reach * phys:GetMass(), tr.HitPos )
- end
- end
- local tr = {}
- tr.start = self.Owner:GetShootPos()
- tr.endpos = self.Owner:GetShootPos() + ( self.Owner:GetAimVector() * (self.Reach+10.7) )
- tr.filter = self.Owner
- tr.mask = MASK_SHOT
- local trace = util.TraceLine( tr )
- if ( trace.Hit ) then
- bullet = {}
- bullet.Num = 1
- bullet.Src = self.Owner:GetShootPos()
- bullet.Dir = self.Owner:GetAimVector()
- bullet.Spread = Vector(0, 0, 0)
- bullet.Tracer = 0
- bullet.Force = 1
- bullet.Damage = 0
- self.Owner:FireBullets(bullet)
- end
- end
- end
- function SWEP:AttackStuff_DamageBreak()
- if CurTime() > self:GetFakeTimerShoot3() && self:GetFakeTimerShoot3() > 0 then
- self:SetFakeTimerShoot3(0)
- local tr = util.TraceLine( {
- start = self.Owner:GetShootPos(),
- endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
- filter = self.Owner,
- mask = MASK_SHOT_HULL
- } )
- if ( !IsValid( tr.Entity ) ) then
- tr = util.TraceHull( {
- start = self.Owner:GetShootPos(),
- endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
- filter = self.Owner,
- mins = Vector( -10, -10, -8 ),
- maxs = Vector( 10, 10, 8 ),
- mask = MASK_SHOT_HULL
- } )
- end
- if ( SERVER && IsValid( tr.Entity ) && tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetShield_Blocking() == true) then
- tr.Entity:GetViewModel():SendViewModelMatchingSequence( tr.Entity:GetViewModel():LookupSequence( "Block_Break" ) )
- tr.Entity:EmitSound( "weapons/DarkSouls/Parry_Sucess.wav" )
- tr.Entity:GetActiveWeapon():SetSword_Stunned(CurTime() + tr.Entity:GetViewModel():SequenceDuration()* (1/tr.Entity:GetActiveWeapon().SwingSpeed))
- tr.Entity:GetActiveWeapon():SetShield_Blocking(false)
- tr.Entity:ResetLuaAnimation("sword_stunned")
- tr.Entity:StopLuaAnimation("sword_godefend")
- if SERVER then
- if(tr.Entity:GetViewModel().Shield and tr.Entity:GetViewModel().Shield:IsValid()) then
- tr.Entity:GetViewModel().Shield:Remove()
- return true
- end
- end
- 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
- tr.Entity:GetOwner():GetViewModel():SendViewModelMatchingSequence( tr.Entity:GetOwner():GetViewModel():LookupSequence( "Block_Break" ) )
- tr.Entity:GetOwner():EmitSound( "weapons/DarkSouls/Parry_Sucess.wav" )
- tr.Entity:GetOwner():GetActiveWeapon():SetSword_Stunned(CurTime() + tr.Entity:GetOwner():GetViewModel():SequenceDuration()* (1/tr.Entity:GetOwner():GetActiveWeapon().SwingSpeed))
- tr.Entity:GetOwner():GetActiveWeapon():SetShield_Blocking(false)
- tr.Entity:GetOwner():ResetLuaAnimation("sword_stunned")
- tr.Entity:GetOwner():StopLuaAnimation("sword_godefend")
- if SERVER then
- if(tr.Entity:GetOwner():GetViewModel().Shield and tr.Entity:GetOwner():GetViewModel().Shield:IsValid()) then
- tr.Entity:GetOwner():GetViewModel().Shield:Remove()
- return true
- end
- end
- end
- end
- end
- function SWEP:AttackStuff_Damage()
- -- Visions of Despair, Try back
- local damage = self.Primary.Damage
- local force = 5000
- self.Owner:LagCompensation( true )
- if CurTime() > self:GetFakeTimerShoot() && self:GetFakeTimerShoot() > 0 && self:GetSword_AlreadyAttacking() == false then
- self:SetFakeTimerShoot(0)
- local tr = util.TraceLine( {
- start = self.Owner:GetShootPos(),
- endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
- filter = self.Owner,
- mask = MASK_SHOT_HULL
- } )
- --PITAS CONTRIBUTIONS
- if self.Owner:GetEyeTrace().Entity:GetClass() == "training_dummy" then
- local steamID = self.Owner:SteamID()
- local chance = 5 -- 1/chance is the chance of getting xp
- local randnum = math.ceil(math.Rand(0,chance))
- if randnum == 1 then
- if CRAFTINGMOD.User[steamID] ~= nil then
- CRAFTINGMOD.User[steamID].Levels:AddExperience( "Strength", math.ceil(math.Rand(1,50)) , self.Owner ) ------THIS IS WHERE I ADDED THE TRAINING DUMMY (PITA)
- end
- elseif randnum == 2 then
- if CRAFTINGMOD.User[steamID] ~= nil then
- CRAFTINGMOD.User[steamID].Levels:AddExperience( "Dexterity", math.ceil(math.Rand(1,50)) , self.Owner ) ------THIS IS WHERE I ADDED THE TRAINING DUMMY (PITA)
- end
- end
- end
- if self.Owner:GetEyeTrace().Entity:GetClass() == "farmingmod_cropplot" then
- self.Owner:GetEyeTrace().Entity:Remove()
- end
- if ( !IsValid( tr.Entity ) ) then
- tr = util.TraceHull( {
- start = self.Owner:GetShootPos(),
- endpos = self.Owner:GetShootPos() + self.Owner:GetAimVector() * self.Reach,
- filter = self.Owner,
- mins = Vector( -10, -10, -8 ),
- maxs = Vector( 10, 10, 8 ),
- mask = MASK_SHOT_HULL
- } )
- end
- 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
- self:SetSword_FakeTimer1(0)
- self:SetSword_FakeTimer2(0)
- self:SetSword_FakeTimer3(0)
- self:SetSword_CanAttack(false)
- if self:GetSword_AttackType() == 1 || self:GetSword_AttackType() == 3 then
- self.Owner:ViewPunch( Angle( -5, 0, 0 ) )
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack1_fail" ) )
- else
- self.Owner:ViewPunch( Angle( 5, 0, 0 ) )
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack2_fail" ) )
- end
- self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- self:EmitSound( "weapons/DarkSouls/block.wav" )
- elseif tr.Hit && IsValid( tr.Entity ) && tr.Entity:IsPlayer() && tr.Entity:GetActiveWeapon().Base == "weapon_ds_base" && tr.Entity:GetActiveWeapon():GetShield_Parrying() then
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack_parry" ) )
- self:EmitSound( "weapons/DarkSouls/Parry_Sucess.wav" )
- self:SetSword_FakeTimer1(0)
- self:SetSword_FakeTimer2(0)
- self:SetSword_FakeTimer3(0)
- self:SetSword_Stunned(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- self.Owner:Freeze(true)
- self.Owner:ResetLuaAnimation("sword_stunned")
- self:SetSword_CanAttack(false)
- self:SetShield_Canblock(false)
- 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
- if self:GetSword_AlreadyAttacking() == false && SERVER then
- self:SetSword_AlreadyAttacking(true)
- if tr.Entity:IsNPC() || tr.Entity:IsRagdoll() then
- tr.Entity:EmitSound( "weapons/DarkSouls/Swing_HitFlesh.wav" )
- end
- end
- 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!
- if self:GetSword_AlreadyAttacking() == false && SERVER then
- self:SetSword_AlreadyAttacking(true)
- if !(self:GetSequenceName(self.Owner:GetViewModel():GetSequence()) == "attack_stab") then
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack_stab" ) )
- self.Owner:ResetLuaAnimation("sword_attackstab")
- end
- if tr.Entity:IsNPC() then
- tr.Entity:EmitSound( "weapons/DarkSouls/Swing_HitPowerful.wav" )
- end
- end
- damage = self.Primary.Damage*10
- force = 10000
- elseif tr.Hit && IsValid( tr.Entity ) && tr.Entity:Health() > 0 then
- elseif tr.Hit then
- self:SetSword_FakeTimer1(0)
- self:SetSword_FakeTimer2(0)
- self:SetSword_FakeTimer3(0)
- self:SetSword_CanAttack(false)
- if (self:GetSword_AttackType() == 1 || self:GetSword_AttackType() == 3) then
- self.Owner:ViewPunch( Angle( -5, 0, 0 ) )
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack1_fail" ) )
- self:EmitSound( "weapons/DarkSouls/Swing_HitStuff.wav" )
- else
- self.Owner:ViewPunch( Angle( 5, 0, 0 ) )
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "attack2_fail" ) )
- end
- self:SetSword_FakeTimer3(CurTime() + self.Owner:GetViewModel():SequenceDuration()* (1/self.SwingSpeed))
- if tr.Entity:GetModel() == "models/weapons/w_ds_shieldhitbox.mdl" then
- self:EmitSound( "weapons/DarkSouls/block.wav" )
- else
- self:EmitSound( "weapons/DarkSouls/Swing_HitWorld.wav" )
- end
- end
- if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() || tr.Entity:Health() > 0 ) ) then
- local dmginfo = DamageInfo()
- local attacker = self.Owner
- if ( !IsValid( attacker ) ) then attacker = self end
- dmginfo:SetAttacker( attacker )
- dmginfo:SetInflictor( self )
- dmginfo:SetDamage( damage )
- dmginfo:SetDamageForce( self.Owner:GetForward() * force )
- if ( SERVER && IsValid( tr.Entity ) && ( tr.Entity:IsNPC() || tr.Entity:IsPlayer() || tr.Entity:Health() > 0 )) && IsFirstTimePredicted() then
- 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
- else
- tr.Entity:TakeDamageInfo( dmginfo )
- end
- end
- end
- if ( SERVER && IsValid( tr.Entity ) ) then
- local phys = tr.Entity:GetPhysicsObject()
- if ( IsValid( phys ) ) then
- phys:ApplyForceOffset( self.Owner:GetAimVector() * self.Reach * phys:GetMass(), tr.HitPos )
- end
- end
- local tr = {}
- tr.start = self.Owner:GetShootPos()
- tr.endpos = self.Owner:GetShootPos() + ( self.Owner:GetAimVector() * (self.Reach+10.7) )
- tr.filter = self.Owner
- tr.mask = MASK_SHOT
- local trace = util.TraceLine( tr )
- if ( trace.Hit ) then
- bullet = {}
- bullet.Num = 1
- bullet.Src = self.Owner:GetShootPos()
- bullet.Dir = self.Owner:GetAimVector()
- bullet.Spread = Vector(0, 0, 0)
- bullet.Tracer = 0
- bullet.Force = 1
- bullet.Damage = 1
- self.Owner:FireBullets(bullet)
- end
- end
- self.Owner:LagCompensation( false )
- end
- function SWEP:SendDamage(damage,trace,force)
- end
- -- This is just timers from this point on
- function SWEP:AttackStuff_Timer1()
- if CurTime() > self:GetSword_FakeTimer1() && self:GetSword_FakeTimer1() > 0 then
- self:SetSword_FakeTimer1( 0 )
- self:SetSword_CanAttack(true)
- self:SetSword_Attacking(false)
- end
- end
- function SWEP:AttackStuff_Timer2()
- if CurTime() > self:GetSword_FakeTimer2() && self:GetSword_FakeTimer2() > 0 then
- self:SetSword_FakeTimer2(0)
- self:SetSword_CanAttack(false)
- end
- end
- function SWEP:AttackStuff_Timer3()
- if CurTime() > self:GetSword_FakeTimer3() && self:GetSword_FakeTimer3() > 0 then
- self:SetSword_FakeTimer3(0)
- self:GotoIdleAnim()
- end
- end
- function SWEP:AttackStuff_Timer4()
- if CurTime() > self:GetSword_FakeTimer4() && self:GetSword_FakeTimer4() > 0 then
- self:SetSword_FakeTimer4(0)
- self:GotoIdleAnim()
- end
- end
- function SWEP:AttackStuff_Timer5()
- if CurTime() > self:GetSword_AttackingTimer() && self:GetSword_AttackingTimer() > 0 then
- self:SetSword_AttackingTimer(0)
- self:SetSword_Attacking(true)
- if self:GetSword_AttackType() == 0 then
- self:EmitSound( self.Primary.Sound1,75,100,1,CHAN_ITEM )
- elseif self:GetSword_AttackType() == 1 then
- self:EmitSound( self.Primary.Sound1,75,100,1,CHAN_ITEM )
- elseif self:GetSword_AttackType() == 2 then
- self:EmitSound( self.Primary.Sound2,75,100,1,CHAN_ITEM )
- elseif self:GetSword_AttackType() == 3 then
- self:EmitSound( self.Primary.Sound3,75,100,1,CHAN_ITEM )
- end
- end
- end
- function SWEP:ParryStuff_Timer1()
- if CurTime() > self:GetShield_FakeTimer3() && self:GetShield_FakeTimer3() > 0 then
- self:SetShield_FakeTimer3(0)
- self:SetShield_Parrying(false)
- end
- end
- function SWEP:StunStuff_Timer1()
- if CurTime() > self:GetSword_Stunned() && self:GetSword_Stunned() > 0 then
- self:SetSword_Stunned(0)
- self.Owner:Freeze(false)
- self:GotoIdleAnim()
- end
- end
- -- Legend has it that someone will find these comments funny
- function SWEP:DefendStuff_Timer1()
- if CurTime() > self:GetShield_FakeTimer1() && self:GetShield_FakeTimer1() > 0 then
- self:SetShield_Blocking(true)
- if SERVER then
- local Ent = ents.Create("prop_physics")
- Ent:SetModel("models/weapons/w_ds_shieldhitbox.mdl")
- Ent:SetOwner(self.Owner)
- Ent:Spawn()
- Ent:SetCollisionGroup(COLLISION_GROUP_WEAPON)
- Ent:SetRenderMode( RENDERMODE_TRANSALPHA )
- Ent:SetColor( Color( 255, 255, 255, 0 ) )
- local phys = Ent:GetPhysicsObject()
- phys:AddGameFlag(FVPHYSICS_NO_PLAYER_PICKUP)
- phys:AddGameFlag(FVPHYSICS_NO_IMPACT_DMG)
- phys:AddGameFlag(FVPHYSICS_NO_SELF_COLLISIONS)
- phys:EnableMotion(false)
- self.Shield = Ent
- end
- self:SetShield_FakeTimer1(0)
- self.Owner:GetViewModel():SendViewModelMatchingSequence( self.Owner:GetViewModel():LookupSequence( "blocked_idle" ))
- end
- end
- function SWEP:DefendStuff_Timer2()
- if CurTime() > self:GetShield_FakeTimer2() && self:GetShield_FakeTimer2() > 0 then
- self:SetShield_Canblock(true)
- self:SetShield_FakeTimer2(0)
- self:GotoIdleAnim()
- end
- end
- function SWEP:IdleStuff_Timer1()
- if CurTime() > self:GetSword_FakeTimer4() && self:GetSword_FakeTimer4() > 0 then
- self:SetSword_FakeTimer4(0)
- self:GotoIdleAnim()
- end
- end
- -- Sexy CalcView stuff. Who doesn't like this?
- -- Mushroom Guy, I love you for showing me the awesomeness of Lerp <3333
- if CLIENT then
- local TestVector = Vector(0,0,0)
- local TestVectorAngle = Vector(0,0,0)
- local TestVector2 = Vector(0,0,0)
- local TestVectorAngle2 = Vector(0,0,0)
- local TestVectorTarget = Vector(0,0,0)
- local TestVectorAngleTarget = Vector(0,0,0)
- local CrouchAng=0
- local CrouchAng2=0
- -- Be wary of Fatty but try horse
- function SWEP:GetViewModelPosition(pos, ang)
- local ply = LocalPlayer()
- local weapon = ply:GetActiveWeapon()
- TestVector = LerpVector(10*FrameTime(),TestVector,TestVectorTarget)
- TestVectorAngle = LerpVector(10*FrameTime(),TestVectorAngle,TestVectorAngleTarget)
- ang:RotateAroundAxis(ang:Right(),TestVectorAngle.x )
- ang:RotateAroundAxis(ang:Up(),TestVectorAngle.y )
- ang:RotateAroundAxis(ang:Forward(),TestVectorAngle.z)
- pos = pos + TestVector.z * ang:Up()
- pos = pos + TestVector.y * ang:Forward()
- pos = pos + TestVector.x * ang:Right()
- local Tr = self.Owner:GetEyeTrace()
- if self.Owner:KeyDown(IN_DUCK) then
- TestVectorTarget = self.CrouchPos
- else
- TestVectorTarget = Vector(0,0,0)
- TestVectorAngleTarget = Vector(0,0,0)
- end
- TestVectorTarget = TestVectorTarget + Vector(0 ,0 , 0- math.Clamp(self.Owner:GetVelocity().z / 200,-5,5))
- if self.Owner:KeyDown(IN_DUCK) then
- if CrouchAng < 1 then
- CrouchAng = CrouchAng + 0.01
- CrouchAng2 = CrouchAng2 - 0.01
- end
- else
- if CrouchAng > 0 then
- CrouchAng = CrouchAng - 0.01
- CrouchAng2 = CrouchAng2 + 0.01
- end
- end
- return pos, ang
- end
- end
- -- Draws the picture of the sword in the weapon selection
- function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha )
- surface.SetDrawColor( 255, 255, 255, alpha )
- surface.SetTexture( self.WepSelectIcon )
- y = y + 20
- x = x + 40
- wide = wide - 30
- surface.DrawTexturedRect( x, y, wide/1.5, tall/1.5 )
- end
- function SWEP:DrawWorldModel()
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger1"), Angle(-10,-40,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_R_Finger11"), Angle(0,-65,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger1"), Angle(-10,-20,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Finger11"), Angle(0,-35,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Hand") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Hand"), Angle(0,-30,0) )
- end
- if self:GetShield_Model() == 0 then
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_UpperArm"), Angle(20,40,0) )
- end
- if IsValid(self.Owner) && self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm") != nil then
- self.Owner:ManipulateBoneAngles( self.Owner:LookupBone("ValveBiped.Bip01_L_Forearm"), Angle(0,50,0) )
- end
- end
- self:SetMoveType( MOVETYPE_NONE )
- self:SetParent( self.Owner, -1 )
- self:SetBodygroup(1,self:GetShield_Model())
- self:SetModelScale(1,1,1)
- self:DrawModel()
- end
- RegisterLuaAnimation('sword_attack1', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 8
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -48
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RF = -48
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 7
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RF = -48
- },
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -16,
- RR = -16,
- RF = -32
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- RU = 64
- }
- },
- FrameRate = 5
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 4
- }
- },
- Type = TYPE_GESTURE
- })
- RegisterLuaAnimation('sword_attack1_noshield', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 8
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -48
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 7
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -16,
- RR = -16,
- RF = -32
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- RU = 64
- }
- },
- FrameRate = 5
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 4
- }
- },
- Type = TYPE_GESTURE
- })
- RegisterLuaAnimation('sword_attack2', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- },
- ['ValveBiped.Bip01_R_Clavicle'] = {
- },
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 8
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RF = -48
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- RU = 64,
- RR = -32
- },
- ['ValveBiped.Bip01_R_Clavicle'] = {
- },
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -16,
- RF = -32
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- RR = -48,
- RF = -48
- }
- },
- FrameRate = 8
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RF = -48
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- RU = -32,
- RF = -48
- },
- ['ValveBiped.Bip01_R_Clavicle'] = {
- RU = 16
- },
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RR = 80
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 3
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- },
- ['ValveBiped.Bip01_R_Clavicle'] = {
- },
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 5
- }
- },
- Type = TYPE_GESTURE
- })
- RegisterLuaAnimation('sword_attack2_noshield', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_Hand'] = {
- },
- ['ValveBiped.Bip01_R_Clavicle'] = {
- },
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 8
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_Forearm'] = {
- RU = 64,
- RR = -32
- },
- ['ValveBiped.Bip01_R_Clavicle'] = {
- },
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -16,
- RF = -32
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- RR = -48,
- RF = -48
- }
- },
- FrameRate = 8
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_Hand'] = {
- RU = -32,
- RF = -48
- },
- ['ValveBiped.Bip01_R_Clavicle'] = {
- RU = 16
- },
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RR = 80
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 3
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_Hand'] = {
- },
- ['ValveBiped.Bip01_R_Clavicle'] = {
- },
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 5
- }
- },
- Type = TYPE_GESTURE
- })
- RegisterLuaAnimation('sword_godefend', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 10
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RU = -16,
- RR = -16,
- RF = -16
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- RU = -16,
- RR = 48,
- RF = -32
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- RU = 32
- },
- ['ValveBiped.Bip01_L_Hand'] = {
- RU = -32
- },
- },
- FrameRate = 4
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RU = -16,
- RR = -16,
- RF = -16
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- RU = -16,
- RR = 48,
- RF = -32
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- RU = 32
- },
- ['ValveBiped.Bip01_L_Hand'] = {
- RU = -32
- },
- },
- FrameRate = 0
- }
- },
- Type = TYPE_STANCE
- })
- RegisterLuaAnimation('sword_leavedefend', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RU = -16,
- RR = -16,
- RF = -16
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- RU = -16,
- RR = 48,
- RF = -32
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- RU = 32
- },
- ['ValveBiped.Bip01_L_Hand'] = {
- RU = -32
- },
- },
- FrameRate = 10
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 4
- }
- },
- Type = TYPE_GESTURE
- })
- RegisterLuaAnimation('sword_parry', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- }
- },
- FrameRate = 7
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = 32
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- RR = 32,
- RF = 32
- }
- },
- FrameRate = 7
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = 32
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RU = -32,
- RF = -32
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- RF = 32
- }
- },
- FrameRate = 5
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = 32
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RU = -32,
- RF = -32
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- RF = 32
- }
- },
- FrameRate = 10
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- }
- },
- FrameRate = 3
- }
- },
- Type = TYPE_GESTURE
- })
- RegisterLuaAnimation('sword_attackstab', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- }
- },
- FrameRate = 10
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = 112
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RF = -48
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- }
- },
- FrameRate = 5
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RF = -48
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- RU = 64
- },
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -48,
- RF = -32
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- RR = -64
- }
- },
- FrameRate = 5
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- }
- },
- FrameRate = 5
- }
- },
- Type = TYPE_GESTURE
- })
- RegisterLuaAnimation('sword_attackstab_noshield', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- }
- },
- FrameRate = 10
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = 112
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- }
- },
- FrameRate = 5
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_Forearm'] = {
- RU = 64
- },
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -48,
- RF = -32
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- RR = -64
- }
- },
- FrameRate = 5
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- },
- ['ValveBiped.Bip01_R_Hand'] = {
- }
- },
- FrameRate = 5
- }
- },
- Type = TYPE_GESTURE
- })
- RegisterLuaAnimation('sword_stunned', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -48
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RF = -48
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 7
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RR = 48
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RR = -80
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- RU = 64
- }
- },
- FrameRate = 4
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RR = 48
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- RR = -80
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- RU = 64
- }
- },
- FrameRate = 2
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- }
- },
- FrameRate = 2
- }
- },
- Type = TYPE_GESTURE
- })
- RegisterLuaAnimation('sword_break', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 7
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -64,
- RF = -80
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- RU = 48
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- RU = 32
- }
- },
- FrameRate = 7
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -64,
- RR = 96,
- RF = -80
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- RU = 48
- }
- },
- FrameRate = 5
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_L_Forearm'] = {
- },
- ['ValveBiped.Bip01_L_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 3
- }
- },
- Type = TYPE_GESTURE
- })
- RegisterLuaAnimation('sword_break_noshield', {
- FrameData = {
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 7
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -64,
- RF = -80
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- RU = 32
- }
- },
- FrameRate = 7
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- RU = -64,
- RR = 96,
- RF = -80
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 5
- },
- {
- BoneInfo = {
- ['ValveBiped.Bip01_R_UpperArm'] = {
- },
- ['ValveBiped.Bip01_R_Forearm'] = {
- }
- },
- FrameRate = 3
- }
- },
- Type = TYPE_GESTURE
- })
- -- Dumbledore kills Snape
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement