Hey so I got a bunch of errors while trying to implement a boss... I'm kind of a noob when it comes to coding too lol anyway here's the code and the error code
using System;
using System.IO;
using Microsoft.Xna.Framework;
using Microsot.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace TheOmegaMod.NPCs.Bosses
{
public class StoneCold : ModNPC
{
public override void SetDefaults()
{
npc.name = "Stone Cold";
npc.displayName = "The Rock Bros.";
npc.aiStyle = 5;
npc.lifeMax = 175000;
npc.damage = 100;
npc.defense = 70;
npc.knockBackResist = 1.10f;
npc.width = 140;
npc.height = 140;
animationType = NPCID.Skeletron;
Main.npcFrameCount[npc.type] = 1;
npc.value = Item.buyPrice(0, 24, 46, 28);
npc.npcSlots = 2f;
npc.boss = true;
npc.lavaImmune = true;
npc.noGravity = true;
npc.noTileCollide = true;
npc.buffImmune[24] = true;
npc.netAlways = true;
}
public override void AutoloadHead(ref string headTexture, ref string bossHeadTexture)
{
bossHeadTexture = "TheOmegaMod/NPCs/Bosses/StoneColdHead";
}
public override void BossLoot(ref string name, ref int potionType);
{
potionType = Item.ID.SuperHealingPotion, 30;
Item.NewItem((int)npc.position.x, (int)npc.position.y, npc.width, npc.height, mod.ItemType("TheStoneColdSword"));
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
npc.lifeMac = (int)(npc.lifeMax * 0.579f * bossLifeScale);
npc.damage = (int)(npc.damage * 0.6f);
}
}
}
And the error code:
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(40,3) : error CS1519: Invalid token '{' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(41,18) : error CS1519: Invalid token '=' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(41,46) : error CS1519: Invalid token ',' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(42,16) : error CS1519: Invalid token '(' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(42,21) : error CS1519: Invalid token ')' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(42,36) : error CS1519: Invalid token ',' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(42,42) : error CS1519: Invalid token ')' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(42,57) : error CS1519: Invalid token ',' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(42,68) : error CS1519: Invalid token ',' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(42,80) : error CS1519: Invalid token ',' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(42,94) : error CS1519: Invalid token '(' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(44,19) : error CS1518: Expected class, delegate, enum, interface, or struct
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\StoneCold.cs(50,1) : error CS1022: Type or namespace definition, or end-of-file expected
Another boss code:
using System
using System.IO;
using Microsoft.Xna.Framework;
using Microsot.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace TheOmegaMod.NPCs.Bosses
{
public class TheRock : ModNPC
{
public override void SetDefaults()
{
npc.name = "The Rock";
npc.displayName = "The Rock Bros.";
npc.aiStyle = 5;
npc.lifeMax = 145000;
npc.damage = 65;
npc.defense = 60;
npc.knockBackResist = 0.85f;
npc.width = 140;
npc.height = 140;
animationType = NPCID.Skeletron;
Main.npcFrameCount[npc.type] = 1;
npc.value = Item.buyPrice(0, 21, 29, 17);
npc.npcSlots = 2f;
npc.boss = true;
npc.lavaImmune = true;
npc.noGravity = true;
npc.noTileCollide = true;
npc.buffImmune[24] = true;
npc.netAlways = true;
}
public override void AutoloadHead(ref string headTexture, ref string bossHeadTexture)
{
bossHeadTexture = "TheOmegaMod/NPCs/Bosses/TheRockHead";
}
public override void BossLoot(ref string name, ref int potionType);
{
potionType = Item.ID.SuperHealingPotion, 20;
Item.NewItem((int)npc.position.x, (int)npc.position.y, npc.width, npc.height, mod.ItemType("TheRockSword"));
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
npc.lifeMac = (int)(npc.lifeMax * 0.579f * bossLifeScale);
npc.damage = (int)(npc.damage * 0.6f);
}
}
}
Another error code:
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(1,13) : error CS1002: ; expected
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(40,3) : error CS1519: Invalid token '{' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(41,18) : error CS1519: Invalid token '=' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(41,46) : error CS1519: Invalid token ',' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(42,16) : error CS1519: Invalid token '(' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(42,21) : error CS1519: Invalid token ')' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(42,36) : error CS1519: Invalid token ',' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(42,42) : error CS1519: Invalid token ')' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(42,57) : error CS1519: Invalid token ',' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(42,68) : error CS1519: Invalid token ',' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(42,80) : error CS1519: Invalid token ',' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(42,94) : error CS1519: Invalid token '(' in class, struct, or interface member declaration
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(44,19) : error CS1518: Expected class, delegate, enum, interface, or struct
c:\Users\nick\Documents\My Games\Terraria\ModLoader\Mod Sources\TheOmegaMod\NPCs\Bosses\TheRock.cs(50,1) : error CS1022: Type or namespace definition, or end-of-file expected
So if anybody at all took the time to read through any of that at all, thank you