gaetes
Skeletron
I want to make a custom boss status message but found nothing on the internet or in ExampleMod about a status message appearing when the boss appears. Can anybody help me?
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace ZombieApocalypse.NPCs
{
[AutoloadBossHead]
public class PatientZero : ModNPC
{
public override void SetStaticDefaults() {
DisplayName.SetDefault("Patient Zero");
Main.npcFrameCount[npc.type] = Main.npcFrameCount[NPCID.Zombie];
}
public override void SetDefaults() {
npc.width = 18;
npc.height = 40;
npc.damage = 30;
npc.defense = 16;
npc.lifeMax = 1500;
npc.HitSound = SoundID.NPCHit1;
npc.DeathSound = SoundID.NPCDeath2;
npc.value = 60f;
npc.knockBackResist = 0.5f;
npc.aiStyle = 3;
npc.boss = true;
aiType = NPCID.Zombie;
animationType = NPCID.Zombie;
banner = Item.NPCtoBanner(NPCID.Zombie);
bannerItem = Item.BannerToItem(banner);
music = mod.GetSoundSlot(SoundType.Music, "ZombieApocalypse/Sounds/Music/DeathEssence");
}
public override float SpawnChance(NPCSpawnInfo spawnInfo) {
return SpawnCondition.OverworldNightMonster.Chance * 0.5f;
}
public override void NPCLoot()
{
if (Main.rand.Next(2) == 1)
Item.NewItem(npc.getRect(), ItemID.WizardHat);
}
public override void HitEffect(int hitDirection, double damage)
{
for (int i = 0; i < 10; i++) {
int dustType = Main.rand.Next(139, 143);
int dustIndex = Dust.NewDust(npc.position, npc.width, npc.height, dustType);
Dust dust = Main.dust[dustIndex];
dust.velocity.X = dust.velocity.X + Main.rand.Next(-50, 51) * 0.01f;
dust.velocity.Y = dust.velocity.Y + Main.rand.Next(-50, 51) * 0.01f;
dust.scale *= 1f + Main.rand.Next(-30, 31) * 0.01f;
}
}
}
}