hi guys! So i am trying to make a weapon that fires the lunatic cultist lightning orb and I added the it should be friendlly, but when i tested it, it hurts me insted of the enemies! How should I fix it? Here is my code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace YourModName.Projectiles
{
public class Shattern : ModProjectile
{
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.CultistBossLightningOrb);
projectile.name = "Spirit Sphere";
projectile.friendly = true;
projectile.hostile = false;
projectile.penetrate = 20;
aiType = ProjectileID.CultistBossLightningOrb;
}
public override void AI()
{
if (Main.rand.Next(10) == 0)
{
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y - 5f, Main.rand.Next(-7, 9) * 5f, Main.rand.Next(-8, -3) * .5f, ProjectileID.CultistBossLightningOrb, (int)(projectile.damage * 1f), 0, projectile.owner);
if (Main.rand.Next(1) == 0)
{
int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType(""));
Main.dust[dust].velocity /= 1f;
}
}
}
}
}
PS: I don't know why the "curly brackets" are not in the perfect place but in my code, it has different alignment and as well as the codes.