the projectile

                Never    
C#
       
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
 
namespace TheBook.Projectiles
{
    public class DirtBossFireBall : ModProjectile
    {
        public override void SetDefaults()
        {
            //projectile.name = "BlastGreen";
			//projectile.CloneDefaults(ProjectileID.FireballF2);
            projectile.width = 32; //size of each frame
            projectile.height = 32; //size of each frame
            projectile.friendly = false; //ttue for hit its own self false if not
            projectile.penetrate = -1;                       //this is the projectile penetration
            Main.projFrames[projectile.type] = 4;           //this is projectile frames
            projectile.hostile = false;
            projectile.magic = true;                        //this make the projectile do magic damage
            projectile.tileCollide = true;                 //this make that the projectile does not go thru walls
            projectile.ignoreWater = true;
			projectile.aiStyle = 24; //a style
			projectile.light = 0.4f; //Lights up the whole room
			projectile.rotation += (float)projectile.direction * 1.9f; //Spins in a good speed
            //projectile.alpha = 128; //Semi Transparen
        }
 
        public override void AI()
        {
			
			// Spawn dust 73 in ModProjectile.AI, but only 1/6th of the time (so it is less frequent). Also, scaling down velocity.
				if (Main.rand.Next(6) == 0) //random amount of Dust it will bloom
				{
					int dustnumber = Dust.NewDust(projectile.position, projectile.width, projectile.height, 42, 0f, 0f, 42, default(Color), 1.8f);
					Main.dust[dustnumber].velocity *= 0.3f;
				}
				
				//if Player owner = Main.player(projectile.owner);
				for (int i = 0; i < 1; i++) //change the 1 for the amount of Projectiles
				{
					// Calculate new speeds for other projectiles.
					// Rebound at 40% to 70% speed, plus a random amount between -8 and 8
					float speedX = -projectile.velocity.X * Main.rand.NextFloat(.4f, .7f) + Main.rand.NextFloat(-8f, 8f);
					float speedY = -projectile.velocity.Y * Main.rand.Next(40, 70) * 0.01f + Main.rand.Next(-20, 21) * 0.4f; // This is Vanilla code, a little more obscure.
					// Spawn the Projectile.
					Projectile.NewProjectile(projectile.position.X + speedX, projectile.position.Y + speedY, speedX, speedY, 90, (int)(projectile.damage * 0.6), 0f, projectile.owner, 0f, 0f);
				}
				
            //this is projectile dust
            //int DustID2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width + 2, projectile.height + 2, mod.DustType("DustName"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 20, default(Color), 1.5f);
            //Main.dust[DustID2].noGravity = true;
                                                          //this make that the projectile faces the right way
            projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
            projectile.localAI[0] += 1f;
			projectile.aiStyle = 9; //a style
			//projectile.aiStyle = 36; //a style
            projectile.alpha = (int)projectile.localAI[0] * 2;
        
            if (projectile.localAI[0] > 130f) //projectile time left before disappears
            {
                projectile.Kill();
            }
           
        }
		
		public override void OnHitNPC(NPC n, int damage, float knockback, bool crit)
        {
            
			Player owner = Main.player[projectile.owner];
            int rand = Main.rand.Next(2); //Generates an integer from 0 to 1
            if(rand == 0)
            {
                n.AddBuff(183, 98); //On Poisoned! debuff for 3 seconds;
				n.AddBuff(182, 98); //On Poisoned! debuff for 3 seconds;
				n.AddBuff(151, 60); //On Poisoned! debuff for 3 seconds;
				
            }
            else if (rand == 1);

			
			//target.AddBuff(BuffID.Poisoned, 1 * 18);
        }
		
        public override bool PreDraw(SpriteBatch sb, Color lightColor) //this is where the animation happens
        {
            projectile.frameCounter++; //increase the frameCounter by one
            if (projectile.frameCounter >= 10) //once the frameCounter has reached 10 - change the 10 to change how fast the projectile animates
            {
                projectile.frame++; //go to the next frame
                projectile.frameCounter = 0; //reset the counter
                if (projectile.frame > 3) //if past the last frame
                    projectile.frame = 0; //go back to the first frame
            }
            return true;
        }
    }
}

Raw Text