using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace TModLoaderFirstMod.NPCs
{
public class EyeOfMadness : ModNPC
{
public override bool Autoload(ref string name, ref string texture)
{
name = "Eye Of Madness";
return mod.Properties.Autoload;
}
public override void SetDefaults()
{
npc.name = "Eye Of Madness";
npc.townNPC = false;
npc.friendly = false;
npc.width = 110;
npc.height = 152;
npc.aiStyle = 4;
npc.damage = 47;
npc.defense = 2;
npc.lifeMax = 5004;
npc.boss = true;
npc.noGravity = true;
npc.soundHit = 1;
npc.soundKilled = 1;
npc.knockBackResist = 1f;
npc.noTileCollide = true;
Main.npcFrameCount[npc.type] = 2;
animationType = NPCID.EyeofCthulhu;
music = MusicID.TheTowers;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
npc.lifeMax = (int)(npc.lifeMax * 0.476f * bossLifeScale);
npc.damage = 50;
}
public override bool PreNPCLoot()
{
return false;
}
public override void BossLoot(ref string name, ref int potionType)
{
name = "Eye of Madness";
potionType = ItemID.ManaPotion;
}
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, Terraria.ID.ItemID.UnholyArrow, 20 + Main.rand.Next(30));
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, Terraria.ID.ItemID.IronBroadsword);
if (Main.rand.Next(10) == 0)
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, Terraria.ID.ItemID.KingStatue);
}
}
}
}
Top of spoiler