EFFECT.Mat = Material( "effects/select_ring" ) /*--------------------------------------------------------- Initializes the effect. The data is a table of data which was passed from the server. ---------------------------------------------------------*/ function EFFECT:Init( data ) local TargetEntity = data:GetEntity() if ( !TargetEntity || !TargetEntity:IsValid() ) then return end --local vOffset = TargetEntity:GetPos() local vOffset = LocalPlayer():GetPos() local vAng = TargetEntity:GetAngles() vAng = vAng:Forward() local Low, High = TargetEntity:WorldSpaceAABB() local NumParticles = 200 local emitter = ParticleEmitter( vOffset ) for i=0, NumParticles do vPos = Vector( vOffset.x + mathx.Rand(-512,512), vOffset.y + mathx.Rand(-512,512), vOffset.z+256 ) local sin = math.sin(i/16) local cos = math.cos(i/16) local particle = emitter:Add( "effects/snowflake", vPos ) local rand = Vector( mathx.Rand( -2, 2 ), mathx.Rand( -2, 2 ), mathx.Rand( 2, 6 ) ) * 50 if (particle) then particle:SetVelocity( rand*-1 ) particle:SetLifeTime( 0 ) particle:SetDieTime( 2 ) particle:SetStartAlpha( mathx.Rand( 200, 255 ) ) particle:SetEndAlpha( 0 ) particle:SetStartSize( 1 ) particle:SetEndSize( 1 ) particle:SetRoll( mathx.Rand(0, 360) ) particle:SetRollDelta( 0 ) end end emitter:Finish() end /*--------------------------------------------------------- THINK ---------------------------------------------------------*/ function EFFECT:Think( ) return false end /*--------------------------------------------------------- Draw the effect ---------------------------------------------------------*/ function EFFECT:Render() end