How do i make my weapons shoot projectiles?

It's a joke to Eldrazi bekus there "Eldrazi's" `:D
I was hoping he would like it!!:kingslime:
Your looks good to me:pinky:
I've always likes Emrakul.
Anyways, for your 'shower' projectile, take a look at the following item and projectile code:
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace MyMod.Items
{
    public class MyItem : ModItem
    {
        public override void SetDefaults()
        {
            this.name = "MyItem";
            this.width = 16;
            this.height = 16;
            this.value = 50;
            this.rare = 4;
           
            this.damage = 20;
            this.knockBack = 2f;
            this.useStyle = 5;
            this.useTime = 6;
            this.useAnimation = 18;
            // Since useAnimation is set to 18 and useTime is set to 6, this item will be fired 3 times everytime it's used (since 18 / 6 = 3). 
                       
            this.magic = true;
            this.noMelee = true
            this.autoReuse = true;
           
            this.shoot = mod.ProjectileType("MyProjectile");
            this.shootSpeed = 10f;
           
            this.useSound = 13;
        }
    }
}
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace MyMod.Projectiles
{
    public class MyProjectile : ModProjectile
    {
        public override void SetDefaults()
        {           
            projectile.name = "My Projectile";
           
            projectile.width = 32;
            projectile.height = 32;
           
            projectile.friendly = true;
            projectile.alpha = 255;
            projectile.penetrate = 5;
            projectile.extraUpdates = 2;
            projectile.ignoreWater = true;
            projectile.magic = true;
        }
   
        public override bool PreAI()
        {
            projectile.scale -= 0.002f;
            if (projectile.scale <= 0f)
            {
                projectile.Kill();
            }
            if (projectile.ai[0] <= 3f)
            {
                projectile.ai[0] += 1f;
                return false;
            }
            projectile.velocity.Y = projectile.velocity.Y + 0.075f;
            for (int i = 0; i < 3; i++)
            {
                float x = projectile.velocity.X / 3f * i;
                float y = projectile.velocity.Y / 3f * i;
                int num154 = 14;
                int newDust = Dust.NewDust(new Vector2(projectile.position.X + 14, this.position.Y + 14), projectile.width - 14 * 2, projectile.height - 14 * 2, 170, 0f, 0f, 100, default(Color), 1f);
                Main.dust[newDust].noGravity = true;
                Main.dust[newDust].velocity *= 0.1f;
                Main.dust[newDust].velocity += projectile.velocity * 0.5f;
                Dust dust = Main.dust[newDust];
                dust.position.X = dust.position.X - x;
                dust.position.Y = dust.position.Y - y;
            }
            if (Main.rand.Next(8) == 0)
            {
                int newDust = Dust.NewDust(new Vector2(projectile.position.X + 16, projectile.position.Y + 16), projectile.width - 16 * 2, projectile.height - 16 * 2, 170, 0f, 0f, 100, default(Color), 0.5f);
                Main.dust[newDust].velocity *= 0.25f;
                Main.dust[newDust].velocity += projectile.velocity * 0.5f;
                return;
            }
       
            return false;
        }
    }
}
 
Thank you so much`:happy:
I had all 3 but sold them as no one would play with me with them as i ran a Elf mana ramp with Elvish Pipers and
Fauna Shamans!!! `:naughty:
Sold Emrakul for 46 and when i went back it was selling back for 126 `:sigh:
 
I need help i keep getting this and i did from what it seems every thing right..`:sigh:

c:\Users\Brown\Documents\My Games\Terraria\ModLoader\Mod Sources\CursesOfInnocence\Items\CursesOfInnocence.cs(38,32) : error CS0117: 'Terraria.ID.ItemID' does not contain a definition for 'LamentOfInnocence'

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace LamentOfInnocence.Items
{
public class LamentOfInnocence : ModItem
{
public override void SetDefaults()
{
item.name = "Lament Of Innocence";
item.damage = 80;
item.melee = true;
item.width = 60;
item.height = 60;
item.toolTip = "Ice and water fills the lungs of are foes.";
item.useTime = 22;
item.useAnimation = 22;
item.useStyle = 1;
item.knockBack = 8;
item.value = 10000;
item.rare = 5;
item.useSound = 1;
item.autoReuse = true;
item.useTurn = true;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.WarriorEmblem, 1);
recipe.AddIngredient(ItemID.IceBlade, 1);
recipe.AddIngredient(ItemID.BreakerBlade, 1);
recipe.AddIngredient(ItemID.Frostbrand, 1);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
if(Main.rand.Next(0, 4) == 0)
{
target.AddBuff(BuffID.Frostburn, 900);
}
{
player.AddBuff(BuffID.IceBarrier, 900);
}
}
}
}


and i'm trying to use it as a recipe with this.

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace CursesOfInnocence.Items
{
public class CursesOfInnocence : ModItem
{
public override void SetDefaults()
{
item.name = "Curses Of Innocence";
item.damage = 110;
item.melee = true;
item.width = 65;
item.height = 65;
item.toolTip = ".";
item.useTime = 23;
item.useAnimation = 23;
item.useStyle = 1;
item.knockBack = 8;
item.value = 10000;
item.rare = 6;
item.useSound = 1;
item.autoReuse = true;
item.useTurn = true;
item.shoot = mod.ProjectileType("ChaosFire");
item.shootSpeed = 6f;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.WarriorEmblem, 1);
recipe.AddIngredient(ItemID.LamentOfInnocence, 1);
recipe.AddIngredient(ItemID.CurseOfDarkness, 1);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
if(Main.rand.Next(0, 4) == 0)
{
target.AddBuff(BuffID.Chilled, 500);
}
{
target.AddBuff(BuffID.OnFire, 500);
}
{
target.AddBuff(BuffID.Shadowflame, 150);
}
{
target.AddBuff(BuffID.Ichor, 100);
}
}
}
}
 
I need help i keep getting this and i did from what it seems every thing right..`:sigh:

c:\Users\Brown\Documents\My Games\Terraria\ModLoader\Mod Sources\CursesOfInnocence\Items\CursesOfInnocence.cs(38,32) : error CS0117: 'Terraria.ID.ItemID' does not contain a definition for 'LamentOfInnocence'

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace LamentOfInnocence.Items
{
public class LamentOfInnocence : ModItem
{
public override void SetDefaults()
{
item.name = "Lament Of Innocence";
item.damage = 80;
item.melee = true;
item.width = 60;
item.height = 60;
item.toolTip = "Ice and water fills the lungs of are foes.";
item.useTime = 22;
item.useAnimation = 22;
item.useStyle = 1;
item.knockBack = 8;
item.value = 10000;
item.rare = 5;
item.useSound = 1;
item.autoReuse = true;
item.useTurn = true;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.WarriorEmblem, 1);
recipe.AddIngredient(ItemID.IceBlade, 1);
recipe.AddIngredient(ItemID.BreakerBlade, 1);
recipe.AddIngredient(ItemID.Frostbrand, 1);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
if(Main.rand.Next(0, 4) == 0)
{
target.AddBuff(BuffID.Frostburn, 900);
}
{
player.AddBuff(BuffID.IceBarrier, 900);
}
}
}
}


and i'm trying to use it as a recipe with this.

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace CursesOfInnocence.Items
{
public class CursesOfInnocence : ModItem
{
public override void SetDefaults()
{
item.name = "Curses Of Innocence";
item.damage = 110;
item.melee = true;
item.width = 65;
item.height = 65;
item.toolTip = ".";
item.useTime = 23;
item.useAnimation = 23;
item.useStyle = 1;
item.knockBack = 8;
item.value = 10000;
item.rare = 6;
item.useSound = 1;
item.autoReuse = true;
item.useTurn = true;
item.shoot = mod.ProjectileType("ChaosFire");
item.shootSpeed = 6f;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.WarriorEmblem, 1);
recipe.AddIngredient(ItemID.LamentOfInnocence, 1);
recipe.AddIngredient(ItemID.CurseOfDarkness, 1);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
{
if(Main.rand.Next(0, 4) == 0)
{
target.AddBuff(BuffID.Chilled, 500);
}
{
target.AddBuff(BuffID.OnFire, 500);
}
{
target.AddBuff(BuffID.Shadowflame, 150);
}
{
target.AddBuff(BuffID.Ichor, 100);
}
}
}
}
ItemID.Something is for vanilla items. mod.ItemType("Something") is for mod items.
 
How would i put that or were i'm still learning and never have add items that are mods into a recipe?

Code:
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace PreHardmodeWings.Items
{
    public class TreeFoliageWings : ModItem
    {
        public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
        {
            equips.Add(EquipType.Wings);
            return true;
        }

        public override void SetDefaults()
        {
            item.name = "Tree leaves Wings";
            item.width = 32;
            item.height = 32;
            item.toolTip = "Made of the Foliage of Trees!.";
            item.value = 10;
            item.rare = 2;
            item.accessory = true;
        }

        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            player.wingTimeMax = 10;
        }

        public override void VerticalWingSpeeds(ref float ascentWhenFalling, ref float ascentWhenRising,
            ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
        {
            ascentWhenFalling = 0.85f;
            ascentWhenRising = 0.15f;
            maxCanAscendMultiplier = 1f;
            maxAscentMultiplier = 3f;
            constantAscend = 0.135f;
        }

        public override void HorizontalWingSpeeds(ref float speed, ref float acceleration)
        {
            speed = 1.1f;
            acceleration *= 2.5f;
        }

        public override void AddRecipes() 
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(null,"WingSkelett", 1);  
            recipe.AddIngredient(ItemID.Wood, 50);
            recipe.AddTile(TileID.Anvils);  
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}

These Wing Uses a Vannila and a Modded Item
recipe.AddIngredient(null,"WingSkelett", 1); is the Modded Integriedient
recipe.AddIngredient(ItemID.Wood, 50); is the Vannila Integriedient
 
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace LamentOfInnocence.Items
{
    public class LamentOfInnocence : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Lament Of Innocence";
            item.damage = 80;
            item.melee = true;
            item.width = 60;
            item.height = 60;
            item.toolTip = "Ice and water fills the lungs of are foes.";
            item.useTime = 22;
            item.useAnimation = 22;
            item.useStyle = 1;
            item.knockBack = 8;
            item.value = 10000;
            item.rare = 5;
            item.useSound = 1;
            item.autoReuse = true;
            item.useTurn = true;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.WarriorEmblem, 1);
            recipe.AddIngredient(ItemID.IceBlade, 1);
            recipe.AddIngredient(ItemID.BreakerBlade, 1);
            recipe.AddIngredient(ItemID.Frostbrand, 1);
            recipe.AddTile(TileID.MythrilAnvil);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
            public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {   
            if(Main.rand.Next(0, 4) == 0)
            {
               target.AddBuff(BuffID.Frostburn, 900);
            }
            {
               player.AddBuff(BuffID.IceBarrier, 900);
            }
        }
    }
}
[doublepost=1461873438,1461873283][/doublepost]This is the item that it's in the recipe in.

Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namespace CursesOfInnocence.Items
{
    public class CursesOfInnocence : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Curses Of Innocence";
            item.damage = 110;
            item.melee = true;
            item.width = 65;
            item.height = 65;
            item.toolTip = "All will be lost in the darkset of flames and cold ice.";
            item.useTime = 23;
            item.useAnimation = 23;
            item.useStyle = 1;
            item.knockBack = 8;
            item.value = 10000;
            item.rare = 6;
            item.useSound = 1;
            item.autoReuse = true;
            item.useTurn = true;
            item.shoot = mod.ProjectileType("ChaosFire");
            item.shootSpeed = 6f;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.WarriorEmblem, 1);
            recipe.AddIngredient(ItemID.LamentOfInnocence, 1);
            recipe.AddIngredient(ItemID.CurseOfDarkness, 1);
            recipe.AddTile(TileID.MythrilAnvil);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
            public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {   
            if(Main.rand.Next(0, 4) == 0)
            {
               target.AddBuff(BuffID.Chilled, 500);
            }
            {
               target.AddBuff(BuffID.OnFire, 500);
            }
            {
               target.AddBuff(BuffID.Shadowflame, 150);
            }
            {
               target.AddBuff(BuffID.Ichor, 100);
            }
        }
    }
}
 
c:\Users\Brown\Documents\My Games\erraria\ModLoader\Mod Sources\CursesOfInnocence\Items\CursesOfInnocence.cs(38,32) : error CS0117: 'Terraria.ID.ItemID' does not contain a definition for 'LamentOfInnocence'

when i put null, it told me this-

c:\Users\Brown\Documents\My Games\Terraria\ModLoader\Mod Sources\CursesOfInnocence\Items\CursesOfInnocence.cs(37,30) : error CS0103: The name 'LamentOfInnocence' does not exist in the current context

I think i got it `:sigh::kingslime: Thank you for all the help `:happy:
 
Back
Top Bottom