mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
82
lua/entities/npc_vj_hlr2b_merkava/init.lua
Normal file
82
lua/entities/npc_vj_hlr2b_merkava/init.lua
Normal file
@@ -0,0 +1,82 @@
|
||||
--[[
|
||||
| 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/hl2b/merkava.mdl"} -- The game will pick a random model from the table when the SNPC is spawned | Add as many as you want
|
||||
ENT.StartHealth = 500
|
||||
ENT.VJC_Data = {
|
||||
ThirdP_Offset = Vector(-40, 0, 20), -- The offset for the controller when the camera is in third person
|
||||
FirstP_Bone = "body", -- If left empty, the base will attempt to calculate a position for first person
|
||||
FirstP_Offset = Vector(0, 0, 70), -- 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
|
||||
}
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
ENT.VJ_NPC_Class = {"CLASS_PLAYER_ALLY"} -- NPCs with the same class with be allied to each other
|
||||
ENT.FriendsWithAllPlayerAllies = true -- Should this SNPC be friends with all other player allies that are running on VJ Base?
|
||||
|
||||
|
||||
|
||||
ENT.Tank_GunnerENT = "npc_vj_hlr2b_merkava_gun"
|
||||
ENT.Tank_AngleDiffuseNumber = 0
|
||||
ENT.Tank_CollisionBoundSize = 90
|
||||
ENT.Tank_CollisionBoundUp = 100
|
||||
ENT.Tank_DeathSoldierModels = {"models/Humans/Group03m/male_01.mdl","models/Humans/Group03m/male_02.mdl","models/Humans/Group03m/male_03.mdl","models/Humans/Group03m/male_04.mdl","models/Humans/Group03m/male_05.mdl","models/Humans/Group03m/male_06.mdl","models/Humans/Group03m/male_07.mdl","models/Humans/Group03m/male_08.mdl","models/Humans/Group03m/male_09.mdl"} -- The corpses it will spawn on death (Example: A soldier) | false = Don't spawn anything
|
||||
|
||||
util.AddNetworkString("vj_hlr1_merkava_spawneffects")
|
||||
util.AddNetworkString("vj_hlr1_merkava_moveeffects")
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
function ENT:CustomInitialize_CustomTank()
|
||||
self:SetSkin(math.random(0, 1))
|
||||
end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
function ENT:Tank_GunnerSpawnPosition()
|
||||
return self:GetPos() + self:GetUp()*69
|
||||
end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
function ENT:StartSpawnEffects()
|
||||
net.Start("vj_hlr1_merkava_spawneffects")
|
||||
net.WriteEntity(self)
|
||||
net.Broadcast()
|
||||
end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
function ENT:StartMoveEffects()
|
||||
net.Start("vj_hlr1_merkava_moveeffects")
|
||||
net.WriteEntity(self)
|
||||
net.Broadcast()
|
||||
end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
function ENT:Tank_CustomOnThink()
|
||||
-- Keep the skin of the gunner the same!
|
||||
if IsValid(self.Gunner) then
|
||||
self.Gunner:SetSkin(self:GetSkin())
|
||||
end
|
||||
return true
|
||||
end
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
function ENT:GetNearDeathSparkPositions()
|
||||
local randPos = math.random(1,5)
|
||||
if randPos == 1 then
|
||||
self.Spark1:SetLocalPos(self:GetPos() + self:GetRight()*15 + self:GetForward()*-16 + self:GetUp()*120)
|
||||
elseif randPos == 2 then
|
||||
self.Spark1:SetLocalPos(self:GetPos() + self:GetRight()*42 + self:GetForward()*123 + self:GetUp()*50)
|
||||
elseif randPos == 3 then
|
||||
self.Spark1:SetLocalPos(self:GetPos() + self:GetRight()*-42 + self:GetForward()*123 + self:GetUp()*50)
|
||||
elseif randPos == 4 then
|
||||
self.Spark1:SetLocalPos(self:GetPos() + self:GetRight()*60 + self:GetForward()*-40 + self:GetUp()*81)
|
||||
elseif randPos == 5 then
|
||||
self.Spark1:SetLocalPos(self:GetPos() + self:GetRight()*-60 + self:GetForward()*-40 + self:GetUp()*81)
|
||||
end
|
||||
end
|
||||
106
lua/entities/npc_vj_hlr2b_merkava/shared.lua
Normal file
106
lua/entities/npc_vj_hlr2b_merkava/shared.lua
Normal file
@@ -0,0 +1,106 @@
|
||||
--[[
|
||||
| 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_tank_base"
|
||||
ENT.Type = "ai"
|
||||
ENT.PrintName = "Merkava"
|
||||
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"
|
||||
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
local smokeSize = 80
|
||||
local heatSize = 20
|
||||
--
|
||||
net.Receive("vj_hlr1_merkava_spawneffects", function()
|
||||
local ent = net.ReadEntity()
|
||||
if IsValid(ent) then
|
||||
ent.Emitter = ParticleEmitter(ent:GetPos())
|
||||
ent.SmokeEffect1 = ent.Emitter:Add("particles/smokey",ent:GetPos() + ent:GetForward()*-130 + ent:GetRight()*25 + ent:GetUp()*45)
|
||||
ent.SmokeEffect1:SetVelocity(ent:GetVelocity() + ent:GetForward()*-30)
|
||||
ent.SmokeEffect1:SetDieTime(0.6)
|
||||
ent.SmokeEffect1:SetStartAlpha(80)
|
||||
ent.SmokeEffect1:SetEndAlpha(0)
|
||||
ent.SmokeEffect1:SetStartSize(10)
|
||||
ent.SmokeEffect1:SetEndSize(smokeSize)
|
||||
ent.SmokeEffect1:SetRoll(math.Rand(-0.2,0.2))
|
||||
ent.SmokeEffect1:SetColor(150,150,150,255)
|
||||
ent.SmokeEffect1:SetAirResistance(100)
|
||||
|
||||
ent.HeatEffect1 = ent.Emitter:Add("sprites/heatwave",ent:GetPos() + ent:GetForward()*-130 + ent:GetRight()*25 + ent:GetUp()*45)
|
||||
ent.HeatEffect1:SetVelocity(ent:GetForward() * math.Rand(0, 50) + Vector(math.Rand(5, -5),math.Rand(5, -5),math.Rand(5, -5)) + ent:GetVelocity())
|
||||
ent.HeatEffect1:SetDieTime(0.1)
|
||||
ent.HeatEffect1:SetStartAlpha(255)
|
||||
ent.HeatEffect1:SetEndAlpha(255)
|
||||
ent.HeatEffect1:SetStartSize(heatSize)
|
||||
ent.HeatEffect1:SetEndSize(5)
|
||||
ent.HeatEffect1:SetRoll(math.Rand(-50,50))
|
||||
ent.HeatEffect1:SetColor(255,255,255)
|
||||
//ent.HeatEffect1:Finish()
|
||||
ent.Emitter:Finish()
|
||||
|
||||
ent.Emitter = ParticleEmitter(ent:GetPos())
|
||||
ent.SmokeEffect1 = ent.Emitter:Add("particles/smokey",ent:GetPos() + ent:GetForward()*-130 + ent:GetRight()*-28 + ent:GetUp()*45)
|
||||
ent.SmokeEffect1:SetVelocity(ent:GetVelocity() + ent:GetForward()*-30)
|
||||
ent.SmokeEffect1:SetDieTime(0.6)
|
||||
ent.SmokeEffect1:SetStartAlpha(80)
|
||||
ent.SmokeEffect1:SetEndAlpha(0)
|
||||
ent.SmokeEffect1:SetStartSize(10)
|
||||
ent.SmokeEffect1:SetEndSize(smokeSize)
|
||||
ent.SmokeEffect1:SetRoll(math.Rand(-0.2,0.2))
|
||||
ent.SmokeEffect1:SetColor(150,150,150,255)
|
||||
ent.SmokeEffect1:SetAirResistance(100)
|
||||
|
||||
ent.HeatEffect1 = ent.Emitter:Add("sprites/heatwave",ent:GetPos() + ent:GetForward()*-130 + ent:GetRight()*-28 + ent:GetUp()*45)
|
||||
ent.HeatEffect1:SetVelocity(ent:GetForward() * math.Rand(0, 50) + Vector(math.Rand(5, -5),math.Rand(5, -5),math.Rand(5, -5)) + ent:GetVelocity())
|
||||
ent.HeatEffect1:SetDieTime(0.1)
|
||||
ent.HeatEffect1:SetStartAlpha(255)
|
||||
ent.HeatEffect1:SetEndAlpha(255)
|
||||
ent.HeatEffect1:SetStartSize(heatSize)
|
||||
ent.HeatEffect1:SetEndSize(5)
|
||||
ent.HeatEffect1:SetRoll(math.Rand(-50,50))
|
||||
ent.HeatEffect1:SetColor(255,255,255)
|
||||
//ent.HeatEffect1:Finish()
|
||||
ent.Emitter:Finish()
|
||||
end
|
||||
end)
|
||||
---------------------------------------------------------------------------------------------------------------------------------------------
|
||||
net.Receive("vj_hlr1_merkava_moveeffects", function()
|
||||
local ent = net.ReadEntity()
|
||||
if IsValid(ent) then
|
||||
ent.Emitter = ParticleEmitter(ent:GetPos())
|
||||
ent.MoveSmokeEffect1 = ent.Emitter:Add("particles/smokey", ent:GetPos() + ent:GetForward()*-115 + ent:GetRight()*58 + ent:GetUp()*1)
|
||||
ent.MoveSmokeEffect1:SetVelocity(ent:GetForward()*math.Rand(100,200) + Vector(math.Rand(5,-5),math.Rand(5,-5),math.Rand(5,-5)) + ent:GetVelocity())
|
||||
ent.MoveSmokeEffect1:SetDieTime(4)
|
||||
ent.MoveSmokeEffect1:SetStartAlpha(30)
|
||||
ent.MoveSmokeEffect1:SetEndAlpha(0)
|
||||
ent.MoveSmokeEffect1:SetStartSize(math.Rand(12,20))
|
||||
ent.MoveSmokeEffect1:SetEndSize(math.Rand(60,80))
|
||||
ent.MoveSmokeEffect1:SetRoll(math.Rand(-0.2,0.2))
|
||||
ent.MoveSmokeEffect1:SetColor(80,60,20)
|
||||
ent.MoveSmokeEffect1:SetAirResistance(300)
|
||||
ent.MoveSmokeEffect1:SetGravity(Vector(0,0,50))
|
||||
|
||||
ent.MoveSmokeEffect2 = ent.Emitter:Add("particles/smokey", ent:GetPos() + ent:GetForward()*-115 + ent:GetRight()*-58 + ent:GetUp()*1)
|
||||
ent.MoveSmokeEffect2:SetVelocity(ent:GetForward()*math.Rand(100,200) + Vector(math.Rand(5,-5),math.Rand(5,-5),math.Rand(5,-5)) + ent:GetVelocity())
|
||||
ent.MoveSmokeEffect2:SetDieTime(4)
|
||||
ent.MoveSmokeEffect2:SetStartAlpha(30)
|
||||
ent.MoveSmokeEffect2:SetEndAlpha(0)
|
||||
ent.MoveSmokeEffect2:SetStartSize(math.Rand(12,20))
|
||||
ent.MoveSmokeEffect2:SetEndSize(math.Rand(60,80))
|
||||
ent.MoveSmokeEffect2:SetRoll(math.Rand(-0.2,0.2))
|
||||
ent.MoveSmokeEffect2:SetColor(80,60,20)
|
||||
ent.MoveSmokeEffect2:SetAirResistance(300)
|
||||
ent.MoveSmokeEffect2:SetGravity(Vector(0,0,50))
|
||||
ent.Emitter:Finish()
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user