AddCSLuaFile() ENT.Type = "anim" ENT.Base = "base_anim" ENT.Spawnable = false function ENT:Draw() self.Entity:DrawModel() end function ENT:Initialize() if SERVER then self.Entity:SetModel( "models/csgo/weapons/w_eq_incendiarygrenade_thrown.mdl" ) self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) self.Entity:SetSolid( SOLID_VPHYSICS ) self.Entity:PhysicsInit( SOLID_VPHYSICS ) self.Entity:SetCollisionGroup( COLLISION_GROUP_WEAPON ) self.Entity:DrawShadow( true ) end self.ActiveTimer = CurTime() + 1.5 self.IgniteEnd = 0 self.IgniteEndTimer = CurTime() self.IgniteStage = 0 self.IgniteStageTimer = CurTime() end function ENT:Think() if self.IgniteStage == 1 and self.IgniteStageTimer <= CurTime() then if SERVER then for i = 1, 15 do local molotovfire2 = ents.Create( "env_fire" ) molotovfire2:SetPos( self:GetPos() + Vector( math.Rand( -88, 88 ), math.Rand( -88, 88 ), 0 ) ) molotovfire2:SetKeyValue( "firesize", "64" ) molotovfire2:SetKeyValue( "damagescale", "25" ) molotovfire2:SetOwner( self.Owner ) molotovfire2:Spawn() molotovfire2:Fire( "StartFire", "", 0 ) timer.Simple( 7, function() if IsValid( molotovfire2 ) then molotovfire2:Remove() end end ) end end self.IgniteStage = 2 self.IgniteStageTimer = CurTime() + 0.1 end if self.IgniteStage == 2 and self.IgniteStageTimer <= CurTime() then if SERVER then for i = 1, 20 do local molotovfire3 = ents.Create( "env_fire" ) molotovfire3:SetPos( self:GetPos() + Vector( math.Rand( -131, 131 ), math.Rand( -131, 131 ), 0 ) ) molotovfire3:SetKeyValue( "firesize", "64" ) molotovfire3:SetKeyValue( "damagescale", "25" ) molotovfire3:SetOwner( self.Owner ) molotovfire3:Spawn() molotovfire3:Fire( "StartFire", "", 0 ) timer.Simple( 7, function() if IsValid( molotovfire3 ) then molotovfire3:Remove() end end ) end end self.IgniteStage = 3 self.IgniteStageTimer = CurTime() + 0.1 end if self.IgniteStage == 3 and self.IgniteStageTimer <= CurTime() then if SERVER then for i = 1, 25 do local molotovfire4 = ents.Create( "env_fire" ) molotovfire4:SetPos( self:GetPos() + Vector( math.Rand( -175, 175 ), math.Rand( -175, 175 ), 0 ) ) molotovfire4:SetKeyValue( "firesize", "64" ) molotovfire4:SetKeyValue( "damagescale", "25" ) molotovfire4:SetKeyValue( "spawnflags", "2" ) molotovfire4:SetOwner( self.Owner ) molotovfire4:Spawn() molotovfire4:Fire( "StartFire", "", 0 ) timer.Simple( 7, function() if IsValid( molotovfire4 ) then molotovfire4:Remove() end end ) end end self.IgniteStage = 4 self.IgniteStageTimer = CurTime() + 0.1 end if SERVER and self.IgniteEnd == 1 and self.IgniteEndTimer <= CurTime() then self.Entity:Remove() end end function ENT:PhysicsCollide( data ) if SERVER and self.ActiveTimer > CurTime() || data.Speed >= 100 then self.Entity:EmitSound( "CSGO_IncGrenade.Bounce" ) end if self.ActiveTimer <= CurTime() || data.Speed < 100 then if SERVER then for i = 1, 10 do local molotovfire = ents.Create( "env_fire" ) molotovfire:SetPos( self:GetPos() + Vector( math.Rand( -64, 64 ), math.Rand( -64, 64 ), 0 ) ) molotovfire:SetKeyValue( "firesize", "64" ) molotovfire:SetKeyValue( "damagescale", "25" ) molotovfire:SetOwner( self.Owner ) molotovfire:Spawn() molotovfire:Fire( "StartFire", "", 0 ) timer.Simple( 7, function() if IsValid( molotovfire ) then molotovfire:Remove() end end ) end self.Entity:SetMoveType( MOVETYPE_NONE ) self.Entity:SetSolid( SOLID_NONE ) self.Entity:PhysicsInit( SOLID_NONE ) self.Entity:SetCollisionGroup( COLLISION_GROUP_NONE ) self.Entity:SetRenderMode( RENDERMODE_TRANSALPHA ) self.Entity:SetColor( Color( 255, 255, 255, 0 ) ) self.Entity:DrawShadow( false ) self.Entity:EmitSound( "CSGO_Inferno.Start_IncGrenade" ) self.Entity:EmitSound( "CSGO_Inferno.Loop" ) end self.IgniteEnd = 1 self.IgniteEndTimer = CurTime() + 7 self.IgniteStage = 1 self.IgniteStageTimer = CurTime() + 0.1 end end function ENT:OnRemove() if SERVER then self.Entity:StopSound( "CSGO_Inferno.Loop" ) self.Entity:EmitSound( "CSGO_Inferno.FadeOut" ) end end