tModLoader Need help creating custom bow/arrow/projectile I'm not sure.

igiulaW

Terrarian
I want to create a bow where, when I shoot wooden arrows out of it, it inflicts poison to enemies, or it could shoot a custom arrow that inflicts poison. Problem being, I'm really new and can't find how to achieve this anywhere.

Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;

namespace Toiletium.Items
{
    class StingShooter : ModItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Sting Shooter");
        }

        public override void SetDefaults()
        {
            item.scale = 0.8f;

            item.ranged = true;
            item.damage = 13;
            item.knockBack = 3f;
            item.crit = 3;

            item.useTime = 27;
            item.useAnimation = 27;
            item.useStyle = ItemUseStyleID.HoldingUp;
            item.UseSound = SoundID.Item5;

            item.shoot = ProjectileID.WoodenArrowFriendly;
            item.shootSpeed = 8.5f;
            item.useAmmo = AmmoID.Arrow;

            item.value = Item.buyPrice(silver: 8);
            item.rare = ItemRarityID.Blue;
        }

        

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.RichMahogany, 5);
            recipe.AddIngredient(ItemID.JungleSpores, 10);
            recipe.AddIngredient(ItemID.Stinger, 12);
            recipe.AddTile(TileID.Anvils);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}

Here is the code for the bow that I have so far, the bow is in game and can shoot arrows but I'm stuck where I am, any help would be greatly appreciated.
 
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
if (type == ProjectileID.WoodenArrowFriendly)
{
type = ProjectileID.VenomArrow;
}


Add This Its will Work
 
Back
Top Bottom