tModLoader How can I make a skeletron type boss?

gaetes

Skeletron
I want to make a boss similar to skeletron in the way that he has hands, but I don't know how at all.
 
A good start is making the AI, as Skeletron's head and arms use specific AIs for each part (Head AI for the Head, and Skeletron Hand AI for the arms). In case a boss has arms that are different (like Prime's) each arm has its own AI.
 
Ok, i did it, but how can i make custom arms? It has basic skeletron boney arms, how to make my own and connect them with something else, not bones?
 
If you want to just change the skin, you can take the sprites used in game for Skeletron and modify them, use with the same code and he'd have different looking arms.

If you want to change the arms' behavior then you have to modify the AI.
 
No, skeletron head AI automatically spawns regular arms. How to make it spawn my arms? I already made a skeletron boss earlier using an example code, but the thread with the code got deleted and I cant do it again. I can show the code and everything and you can tell me what to do
 
Hand
Desktop Screenshot 2020.11.12 - 14.43.44.39.png
Head
Desktop Screenshot 2020.11.12 - 14.44.03.28.png
 
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using static Terraria.ModLoader.ModContent;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria.DataStructures;
using Terraria.ModLoader;

namespace HybridWorld.NPCs.TAos
{
[AutoloadBossHead]
public class TAos : ModNPC
{

public static int _type;

int timer = 0;
int timer1 = 0;
int timer2 = 0;

public override void SetStaticDefaults()
{
DisplayName.SetDefault("TA-os, mech prototype");

}


public override void SetDefaults()
{
npc.aiStyle = 32;
aiType = NPCID.SkeletronHead;
npc.lifeMax = 60000;
npc.damage = 45;
npc.defense = 20;
npc.knockBackResist = 0f;
npc.width = 160;
npc.height = 160;
npc.value = Item.buyPrice(1, 3, 0, 0);
animationType = NPCID.SkeletronHead;
npc.npcSlots = 1f;
npc.boss = true;
npc.lavaImmune = true;
npc.noGravity = true;
npc.noTileCollide = true;
npc.HitSound = SoundID.NPCHit4;
npc.DeathSound = SoundID.NPCDeath14;
bossBag = mod.ItemType("TaosBag");
npc.buffImmune[24] = false;
music = mod.GetSoundSlot(Terraria.ModLoader.SoundType.Music, "Sounds/Music/TAos");
npc.buffImmune[20] = false;
}
public override void AI()
{
bool expertMode = Main.expertMode;

timer++;
if (timer == 500 || timer == 1000 && npc.life >= (npc.lifeMax / 2))
{
Vector2 direction = Main.player[npc.target].Center - npc.Center;
direction.Normalize();
direction.X *= 14f;
direction.Y *= 14f;

int amountOfProjectiles = Main.rand.Next(15, 20);
for (int i = 0; i < amountOfProjectiles; ++i)
{
float A = (float)Main.rand.Next(-200, 200) * 0.01f;
float B = (float)Main.rand.Next(-200, 200) * 0.01f;
int damage = expertMode ? 70 : 80;
Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X + A, direction.Y + B, ProjectileID.DeathLaser, damage, 1, Main.myPlayer, 0, 0);
}
}
else if (timer == 250 || timer == 750)
{
Vector2 direction = Main.player[npc.target].Center - npc.Center;
direction.Normalize();
direction.X *= 15f;
direction.Y *= 15f;

int amountOfProjectiles = Main.rand.Next(6, 6);
for (int i = 0; i < amountOfProjectiles; ++i)
{
float A = (float)Main.rand.Next(-300, 300) * 0.01f;
float B = (float)Main.rand.Next(-300, 300) * 0.01f;
int damage = expertMode ? 24 : 26;
Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X + A, direction.Y + B, ProjectileID.Fireball, damage, 1, Main.myPlayer, 0, 0);
}
}
if (timer >= 1001)
{
timer = 0;
}
}

public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
npc.lifeMax = (int)(npc.lifeMax * 0.520f * bossLifeScale);
npc.damage = (int)(npc.damage * 0.5f);
npc.defense = (int)(npc.defense * 0.5f);
}
public override void NPCLoot()
{
if (Main.rand.Next(100) == 0)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SoulofFury"), Main.rand.Next(24, 31));
}
if (Main.expertMode)
{
npc.DropBossBags();
}
else
{
int choice = Main.rand.Next(8);
if (choice == 0)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ScrapKnife"));
}
if (choice == 1)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PowerPlug"));
}
if (choice == 2)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LaserCharger"));
}
if (choice == 3)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Tribarrel"));

}
if (choice == 4)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Electrocution"));

}
if (choice == 5)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Scraprain"));

}
if (choice == 6)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MechaballStaff"));

}
if (choice == 7)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TaosSentryStaff"));

}
}
HWWorld.downedTaos = true;
}
}
}











using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using static Terraria.ModLoader.ModContent;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria.DataStructures;
using Terraria.ModLoader;

namespace HybridWorld.NPCs.TAos
{
public class TAosHand : ModNPC
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mechaball");

}

public override void SetDefaults()
{
npc.aiStyle = 36;
aiType = NPCID.PrimeLaser;
npc.lifeMax = 6000;
npc.damage = 30;
npc.defense = 10;
npc.knockBackResist = 0f;
npc.width = 64;
npc.height = 64;
npc.value = Item.buyPrice(0, 0, 0, 0);
animationType = NPCID.PrimeLaser;
npc.npcSlots = 1f;
npc.dontCountMe = true;
npc.lavaImmune = true;
npc.noGravity = true;
npc.noTileCollide = true;
npc.HitSound = SoundID.NPCHit4;
npc.DeathSound = SoundID.NPCDeath14;
npc.buffImmune[24] = false;
npc.buffImmune[20] = false;
}

public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
npc.lifeMax = (int)(npc.lifeMax * 0.520f * bossLifeScale);
npc.damage = (int)(npc.damage * 0.5f);
npc.defense = (int)(npc.defense * 0.5f);
}
}
}
 
Back
Top Bottom