tModLoader Custom EoC/Boss AI?

Geoff Copuc

Skeletron Prime
Hello,

I am trying to make a mod, but I want my Eye of Cthulhu reskin to spawn custom servants of Cthulhu, at the moment I am using:

npc.CloneDefaults(NPCID.EyeofCthulhu);
npc.aiStyle = 4;
animationType = NPCID.EyeofCthulhu;
but I would like the written AI so I can change certain parts,
Any help would be appreciated!

Thanks.
using Terraria.ID;
using Terraria;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Diagnostics;
using System;

namespace geoffmod.npcs.Bosses.EyeOfGeoff
{
[AutoloadBossHead]
public class EyeOfGeoff : ModNPC
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Eye of Geoff");
Main.npcFrameCount[npc.type] = Main.npcFrameCount[NPCID.EyeofCthulhu];
}

public override void SetDefaults()
{
npc.width = 110;
npc.height = 152;
npc.lifeMax = 7500;
npc.damage = 50;
npc.defense = 25;
npc.HitSound = SoundID.NPCHit1;
npc.DeathSound = SoundID.NPCDeath1;
npc.value = Item.buyPrice(gold: 3, silver: 50);
npc.boss = true;
music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/BossMusic2");
npc.lavaImmune = true;
npc.noGravity = true;
npc.noTileCollide = true;
npc.aiStyle = -1;
npc.npcSlots = 5f;
animationType = NPCID.EyeofCthulhu;
bossBag = mod.ItemType("EOGBag");
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{

npc.lifeMax = (int)(npc.lifeMax * bossLifeScale);

npc.damage = (int)(npc.damage * 0.6f);
}
public override void NPCLoot()
{

if (Main.rand.NextFloat() < .1000f) // 10.00% chance
{
Item.NewItem(npc.position, mod.ItemType("EOGTrophy"));
}

if (Main.expertMode)
{
npc.DropBossBags();
}
else
{
Item.NewItem(npc.position, mod.ItemType("OrangeShard"));
Item.NewItem(npc.position, mod.ItemType("GeoffOre"), 10 + Main.rand.Next(15));

if (Main.rand.NextFloat() < .1429) // 14.29% chance
{
Item.NewItem(npc.position, mod.ItemType("EOGMask"));
}
if (Main.rand.NextFloat() < .2500) // 25.00% chance
{
Item.NewItem(npc.position, mod.ItemType("OrangeLens"));
}
if (Main.rand.NextFloat() < .5000) // 50.00% chance
{
Item.NewItem(npc.position, mod.ItemType("EyeballCannon"));
}
else
{
Item.NewItem(npc.position, mod.ItemType("EyeballSword"));
}
}
geoffworld.downedEyeOfGeoff = true;
}
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
{
scale = 1.5f;
return null;
}
}
}
 
Back
Top Bottom