Hi, I have a problem that needs to be solver!
I am creating my own npc, but when i load game it doesn't have her head on minimap and i also cant move her to house, because the option isnt here!
+ If you could write me the sounds from woman npcs so i can give it to her xd
Code(the drop thing and buy thing are not completedxddd)
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace tristanajanna.NPCs.TownNPC
{
public class themermaid : ModNPC
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("The Mermaid");
}
public override void SetDefaults()
{
npc.townNPC = true;
npc.friendly = true;
npc.width = 18;
npc.height = 56;
npc.aiStyle = 7;
npc.damage = 25;
npc.defense = 25;
npc.lifeMax = 250;
npc.HitSound = SoundID.NPCHit1;
npc.DeathSound = SoundID.NPCDeath1;
npc.knockBackResist = 0.5f;
Main.npcFrameCount[npc.type] = 23;
animationType = NPCID.Stylist;
}
public override bool CanTownNPCSpawn(int numTownNPCs, int money) ///spawnuje se kdyz je vytvoren v inventari mod item Mermaid's Lost Pearl
{
for (int k = 0; k < 255; k++)
{
Player player = Main.player[k];
if (player.active)
{
for (int j = 0; j < player.inventory.Length; j++)
{
if (player.inventory[j].type == mod.ItemType("starfishamulet"))
{
return true;
}
}
}
}
return false;
}
public override string TownNPCName()
{ //NPC names
switch (WorldGen.genRand.Next(11))
{
case 0:
return "Ariel";
case 1:
return "Tetra";
case 2:
return "Ava";
case 3:
return "Khoii";
case 4:
return "Coralia";
case 5:
return "Watery";
case 6:
return "Leaf";
case 7:
return "Lorelei";
case 8:
return "Melody";
case 9:
return "Marina";
default:
return "Nami";
}
}
public override string GetChat()
{ //npc chat
switch (Main.rand.Next(5))
{
case 0:
return "People and their air...";
case 1:
return "I decide what the tide will bring!";
case 2:
return "Swim at your own risk!";
case 3:
return "Afraid to get your feet wet?";
default:
return "Thanks a lot for bringing me my lost pearl!";
}
}
public override void SetChatButtons(ref string button, ref string button2)
{
button = "Treasure Shop";
}
public override void OnChatButtonClicked(bool firstButton, ref bool shop)
{
if (firstButton)
{
shop = true;
}
}
public override void SetupShop(Chest shop, ref int nextSlot)
{
shop.item[nextSlot].SetDefaults(mod.ItemType("starfishamulet")); //items that sells
nextSlot++;
shop.item[nextSlot].SetDefaults(mod.ItemType("starfishamulet"));
nextSlot++;
if (Main.hardMode == true) //Checks if the world is hardmode
shop.item[nextSlot].SetDefaults(mod.ItemType("starfishamulet"));
nextSlot++;
}
public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("starfishamulet"));
}
public override bool UsesPartyHat()
{
return false;
}
}
}