mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
59
lua/entities/npc_vj_hlr1_aflock/init.lua
Normal file
59
lua/entities/npc_vj_hlr1_aflock/init.lua
Normal file
@@ -0,0 +1,59 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
AddCSLuaFile("shared.lua")
|
||||
include('shared.lua')
|
||||
/*-----------------------------------------------
|
||||
*** Copyright (c) 2012-2023 by DrVrej, All rights reserved. ***
|
||||
No parts of this code or any of its contents may be reproduced, copied, modified or adapted,
|
||||
without the prior written consent of the author, unless otherwise indicated for stand-alone materials.
|
||||
-----------------------------------------------*/
|
||||
ENT.Model = {"models/vj_hlr/hl1/aflock.mdl"} -- The game will pick a random model from the table when the SNPC is spawned | Add as many as you want
|
||||
ENT.VJC_Data = {
|
||||
FirstP_Bone = "bone12", -- If left empty, the base will attempt to calculate a position for first person
|
||||
FirstP_Offset = Vector(15, 0, 2), -- The offset for the controller when the camera is in first person
|
||||
FirstP_ShrinkBone = false, -- Should the bone shrink? Useful if the bone is obscuring the player's view
|
||||
}
|
||||
-- ====== Flinching Code ====== --
|
||||
ENT.CanFlinch = 1 -- 0 = Don't flinch | 1 = Flinch at any damage | 2 = Flinch only from certain damages
|
||||
ENT.AnimTbl_Flinch = {ACT_BIG_FLINCH} -- If it uses normal based animation, use this
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
function ENT:CustomOnInitialize()
|
||||
self.Boid_Type = 1
|
||||
self:SetCollisionBounds(Vector(18, 18, 10), Vector(-18, -18, 0))
|
||||
self.Boid_FollowOffsetPos = Vector(math.random(-50, 50), math.random(-120, 120), math.random(-150, 150))
|
||||
if !IsValid(HLR_AFlock_Leader) then
|
||||
HLR_AFlock_Leader = self
|
||||
end
|
||||
end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
function ENT:CustomOnThink()
|
||||
if self:Health() <= (self:GetMaxHealth() / 2.2) then
|
||||
self.AnimTbl_IdleStand = {"wounded"}
|
||||
self.Aerial_AnimTbl_Calm = {"wounded"}
|
||||
self.Aerial_AnimTbl_Alerted = {"wounded"}
|
||||
else
|
||||
self.AnimTbl_IdleStand = {ACT_FLY}
|
||||
self.Aerial_AnimTbl_Calm = {ACT_FLY}
|
||||
self.Aerial_AnimTbl_Alerted = {ACT_FLY}
|
||||
end
|
||||
|
||||
if self.VJ_IsBeingControlled then return end
|
||||
if IsValid(HLR_AFlock_Leader) then
|
||||
if HLR_AFlock_Leader != self && HLR_AFlock_Leader.AA_CurrentMovePos then
|
||||
self.DisableWandering = true
|
||||
self:AA_MoveTo(HLR_AFlock_Leader, true, "Calm", {AddPos=self.Boid_FollowOffsetPos, IgnoreGround=true}) -- Medzavorin haladz e (Kharen deghme)
|
||||
end
|
||||
else
|
||||
self.IsGuard = false
|
||||
self.DisableWandering = false
|
||||
HLR_AFlock_Leader = self
|
||||
end
|
||||
end
|
||||
18
lua/entities/npc_vj_hlr1_aflock/shared.lua
Normal file
18
lua/entities/npc_vj_hlr1_aflock/shared.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ENT.Base = "npc_vj_hlr1_boid"
|
||||
ENT.Type = "ai"
|
||||
ENT.PrintName = "AFlock"
|
||||
ENT.Author = "DrVrej"
|
||||
ENT.Contact = "http://steamcommunity.com/groups/vrejgaming"
|
||||
ENT.Purpose = "Spawn it and fight with it!"
|
||||
ENT.Instructions = "Click on the spawnicon to spawn it."
|
||||
ENT.Category = "Half-Life Resurgence"
|
||||
Reference in New Issue
Block a user