Marcin JOT.PE
Terrarian
Hey I got Some problems
How do i fix Head
Can i fix that between parts its a little space
Can someone Help with writing me so ai i wont ai like wyvern
so that what i have

How do i fix Head
Can i fix that between parts its a little space
Can someone Help with writing me so ai i wont ai like wyvern
so that what i have
Code:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace MarcinMod.NPCs.Boss
{
public class ForestDragon_Head : ModNPC
{
public override void SetDefaults()
{
npc.name = "ForestDragon";
npc.displayName = "Forest Dragon";
npc.soundHit = 1;
npc.soundKilled = 1;
npc.lifeMax = 125;
npc.damage = 20;
npc.defense = 17;
npc.knockBackResist = 0.5f;
npc.width = 45; //22
npc.height = 45; //18
npc.boss = true;
npc.lavaImmune = true;
npc.noGravity = true;
npc.noTileCollide = true;
Main.npcFrameCount[npc.type] = 1;
npc.value = Item.buyPrice(0, 0, 1, 45);
npc.npcSlots = 1f;
npc.netAlways = true;
}
public override bool PreAI()
{
if (Main.netMode != 1)
{
if (npc.ai[0] == 0)
{
npc.realLife = npc.whoAmI;
int latestNPC = npc.whoAmI;
int WormLength = 1;
for (int i = 0; i < WormLength; ++i)
{
latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Body"), npc.whoAmI, 0, latestNPC);
Main.npc[(int)latestNPC].realLife = npc.whoAmI;
Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
}
int WormLength2 = 1;
for (int i = 0; i < WormLength2; ++i)
{
latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Legs"), npc.whoAmI, 0, latestNPC);
Main.npc[(int)latestNPC].realLife = npc.whoAmI;
Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
}
int WormLength3 = 4;
for (int i = 0; i < WormLength3; ++i)
{
latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Body"), npc.whoAmI, 0, latestNPC);
Main.npc[(int)latestNPC].realLife = npc.whoAmI;
Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
}
for (int i = 0; i < WormLength2; ++i)
{
latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Legs"), npc.whoAmI, 0, latestNPC);
Main.npc[(int)latestNPC].realLife = npc.whoAmI;
Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
}
for (int i = 0; i < WormLength; ++i)
{
latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Body2"), npc.whoAmI, 0, latestNPC);
Main.npc[(int)latestNPC].realLife = npc.whoAmI;
Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
}
for (int i = 0; i < WormLength; ++i)
{
latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Body3"), npc.whoAmI, 0, latestNPC);
Main.npc[(int)latestNPC].realLife = npc.whoAmI;
Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
}
latestNPC = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("ForestDragon_Tail"), npc.whoAmI, 0, latestNPC);
Main.npc[(int)latestNPC].realLife = npc.whoAmI;
Main.npc[(int)latestNPC].ai[3] = npc.whoAmI;
npc.ai[0] = 1;
npc.netUpdate = true;
}
}
return false;
}
}
}
Last edited: