Sword similar to the Horseman's Blade

SkyanUltra

Terrarian
Hey there. I was wondering if anyone could help me make a sword that fires a projectile upon hit. Here's the current item code, I want it to fire a bone:
C#:
using IL.Terraria.GameContent.UI;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace SkyanTrinkets.Weapons
{
    public class SludgeDagger : ModItem
    {
        public override void SetStaticDefaults()
        {
            Tooltip.SetDefault("Douses the enemy in flammable sludge, which improves the effects of fire" + "\nHitting an enemy will throw a bone");
        }
        public override void SetDefaults()
        {
            item.width = 18;
            item.height = 24;
            item.rare = ItemRarityID.Green;
            item.value = 1000;
            item.melee = true;
            item.useStyle = 3;
            item.damage = 15;
            item.useTime = 10;
            item.useAnimation = 10;
            item.knockBack = 6.5f;
            item.scale = 1.1f;
            item.rare = ItemRarityID.Green;
        }
        public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {
            target.AddBuff(BuffID.Slimed, 200);
            target.AddBuff(BuffID.Oiled, 200);
        }
        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) //When you hit an NPC
        {
            {
                float projectilespeedX = 6f;
                float projectilespeedY = 1f;
                float projectileknockBack = 3f;
                int projectiledamage = 8;
                {
                    Projectile.NewProjectile(player.position.X, player.position.Y, projectilespeedX, projectilespeedY, ProjectileID.Bone, projectiledamage, projectileknockBack, projectile.owner, 0f, 0f);
                }
            }
        }
    }
}
 
Back
Top Bottom