TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ GiveTownUniqueDataToNPCsThatNeedIt()

static void Terraria.NPC.GiveTownUniqueDataToNPCsThatNeedIt ( int Type,
int nextNPC )
inlinestaticprivate

Definition at line 91316 of file NPC.cs.

91317 {
91318 NPC nPC = Main.npc[nextNPC];
91319 if (nPC.isLikeATownNPC || (Type >= 0 && NPCID.Sets.SpawnsWithCustomName[Type]))
91320 {
91321 nPC.GivenName = nPC.getNewNPCName();
91322 if (TownNPCProfiles.Instance.GetProfile(nPC, out var profile))
91323 {
91324 nPC.townNpcVariationIndex = profile.RollVariation();
91325 nPC.GivenName = profile.GetNameForVariant(nPC);
91326 }
91327 if (ShimmeredTownNPCs[Type])
91328 {
91329 nPC.townNpcVariationIndex = 1;
91330 }
91331 nPC.needsUniqueInfoUpdate = true;
91332 }
91333 }
static bool[] SpawnsWithCustomName
Whether or not a given NPC will spawn with a custom name like a town NPC. In order to determine what ...
Definition NPCID.cs:639
static bool[] ShimmeredTownNPCs
Definition NPC.cs:496

References Terraria.GameContent.TownNPCProfiles.Instance, Terraria.Main.npc, and Terraria.ID.NPCID.Sets.SpawnsWithCustomName.