83654 {
83655
83656
83657
83658
83659
83660
83661
83662
83663
83664
83665
83666
83667
83668
83669
83670
83671
83672
83673
83674
83675
83676
83677
83678
83679
83680
83682 {
83683 return;
83684 }
83686 {
83688 }
83690 {
83692 {
83697 if (Main.netMode != 1)
83698 {
83700 Main.npc[
num].ai[3] =
ai[3];
83701 Main.npc[
num].netUpdate =
true;
83702 }
83703 }
83704 return;
83705 }
83706 if (
type == 398 &&
ai[0] != 2
f)
83707 {
83712 return;
83713 }
83715 {
83721 return;
83722 }
83723 if (
type == 548 &&
ai[1] != 1
f)
83724 {
83730 return;
83731 }
83732 if (Main.netMode != 1 && Main.getGoodWorld && (
type == 42 ||
type == 176 || (
type >= 231 &&
type <= 235)))
83733 {
83735 }
83736 if (Main.netMode != 1 && Main.getGoodWorld)
83737 {
83739 {
83741 if (Main.netMode == 2 &&
num3 < 200)
83742 {
83743 NetMessage.SendData(23, -1, -1,
null,
num3);
83744 }
83745 }
83747 {
83749 for (
int i = 0; i <
num4; i++)
83750 {
83752 for (
int j = 0;
j <
num5;
j++)
83753 {
83754 int num6 = (int)(
base.Center.X / 16
f) + Main.rand.Next(-50, 51);
83756 for (
k = (
int)(base.Center.Y / 16
f) + Main.rand.Next(-50, 51);
k < Main.maxTilesY - 200 && !
WorldGen.SolidTile(
num6,
k);
k++)
83757 {
83758 }
83761 {
83763 if (Main.netMode == 2 &&
num7 < 200)
83764 {
83765 NetMessage.SendData(23, -1, -1,
null,
num7);
83766 }
83767 break;
83768 }
83769 }
83770 }
83771 }
83772 }
83774 {
83775 return;
83776 }
83779 {
83780 if (Main.netMode != 2)
83781 {
83783 }
83788 {
83791 }
83794 {
83795 for (
int l = 0;
l < 255;
l++)
83796 {
83797 Player player = Main.player[
l];
83798 if (player != null && player.active && player.difficulty != 2)
83799 {
83801 break;
83802 }
83803 }
83804 }
83806 {
83808 }
83809 if (Main.netMode == 0)
83810 {
83811 Main.NewText(
networkText.ToString(),
byte.MaxValue, 25, 25);
83812 }
83813 else if (Main.netMode == 2)
83814 {
83816 }
83817 }
83818 if (Main.netMode != 1 && !Main.IsItDay() &&
type == 54 && !
AnyNPCs(35))
83819 {
83820 for (
int m = 0;
m < 255;
m++)
83821 {
83822 if (Main.player[
m].active && !Main.player[
m].dead && Main.player[
m].killClothier)
83823 {
83825 break;
83826 }
83827 }
83828 }
83830 {
83831 WorldGen.prioritizedTownNPCType = 0;
83832 }
83835 {
83837 }
83839 {
83841 }
83843 {
83845 {
83847 }
83848 else if (
type == 134)
83849 {
83852 float num9 = 100000000
f;
83854 for (
int n = 0;
n < 200;
n++)
83855 {
83856 if (Main.npc[
n].active && (Main.npc[
n].type == 134 || Main.npc[
n].type == 135 || Main.npc[
n].type == 136))
83857 {
83860 {
83863 }
83864 }
83865 }
83869 }
83870 else
83871 {
83873 }
83874 }
83876 if (Main.getGoodWorld && Main.netMode != 1 &&
type == 631)
83877 {
83879 }
83885 {
83886 return;
83887 }
83890 {
83891 case 216:
83893 break;
83894 case 395:
83896 break;
83897 case 491:
83899 break;
83900 case 471:
83902 break;
83903 case 472:
83905 break;
83906 case 387:
83908 break;
83909 }
83912 {
83913 Main.invasionSize -=
num2;
83914 if (Main.invasionSize < 0)
83915 {
83916 Main.invasionSize = 0;
83917 }
83918 if (Main.netMode != 1)
83919 {
83920 Main.ReportInvasionProgress(Main.invasionSizeStart - Main.invasionSize, Main.invasionSizeStart,
nPCInvasionGroup + 3, 0);
83921 }
83922 if (Main.netMode == 2)
83923 {
83924 NetMessage.SendData(78, -1, -1, null, Main.invasionProgress, Main.invasionProgressMax, Main.invasionProgressIcon);
83925 }
83926 }
83927 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
static void BroadcastChatMessage(NetworkText text, Color color, int excludedPlayer=-1)
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Vector2 position
The position of this Entity in world coordinates.
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
int height
The height of this Entity's hitbox, in pixels.
static void CheckProgress(int slainMonsterID)
static bool[] IsTownPet
If true for a given NPC type (F:Terraria.NPC.type), then that NPC is categorized as a town pet....
static int[] InvasionSlotCount
If above 0 for a given NPC type (F:Terraria.NPC.type), and its associated invasion is NOT a wave-base...
static readonly SoundStyle NPCDeath6
static NetworkText FromKey(string key, params object[] substitutions)
Creates a NetworkText object from a localization key and optional substitutions. The receiving client...
Represents text that will be sent over the network in multiplayer and displayed to the receiving user...
static bool CheckDead(NPC npc)
static bool SpecialOnKill(NPC npc)
This serves as the central class from which NPC-related functions are carried out....
void CheckProgressPumpkinMoon()
int lifeMax
The maximum life of this NPC.
NetworkText GetFullNetName()
void DropTombstoneTownNPC(NetworkText deathText)
bool dontTakeDamageFromHostiles
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
void CheckProgressFrostMoon()
static int GetNPCInvasionGroup(int npcID)
Gets the T:Terraria.ID.InvasionID associated with the given NPC type (F:Terraria.NPC....
static bool AnyNPCs(int Type)
Returns true if there are any active NPC in the world of the given NPC type (F:Terraria....
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
static void SpawnSkeletron(int onWho)
IEntitySource GetSpawnSourceForNPCFromNPCAI()
static int NewNPC(IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)
Spawns an NPC into the game world with the given type. This method should not be called on multipla...
static void LadyBugKilled(Vector2 Position, bool GoldLadyBug=false)
int life
The current life of the NPC. Automatically set to the value of F:Terraria.NPC.lifeMax at the end of S...
IEntitySource GetSpawnSource_ForProjectile()
void DropEoWLoot(bool fromCheckDead=true)
static IEntitySource GetSpawnSourceForNaturalSpawn()
SoundStyle? DeathSound
The sound that plays when this npc dies. Set this to an existing T:Terraria.ID.SoundID entry or assig...
int realLife
Stores the index (the F:Terraria.Entity.whoAmI) of a single NPC. This NPC will then share a health po...
This data type describes in detail how a sound should be played. Passable to the M:Terraria....