tModLoader v2024.03
A mod to make and play Terraria mods
NPCID.Sets Class Reference

Classes

struct  NPCBestiaryDrawModifiers
 Stores the draw parameters for an NPC type (NPC.type) in the Bestiary.
Do not use default to create this struct. Use new NPCBestiaryDrawModifiers() instead to set proper default values. More...
 

Static Public Member Functions

static Dictionary< int, NPCBestiaryDrawModifiersNPCBestiaryDrawOffsetCreation ()
 

Static Public Attributes

static bool[] ActsLikeTownNPC = Factory.CreateBoolSet(453)
 Whether or not a given NPC will act like a town NPC in terms of AI, animations, and attacks, but not in other regards, such as appearing on the minimap, like the bone merchant in vanilla.
 
static bool[] AllNPCs = Factory.CreateBoolSet(true)
 An array of length NPCLoader.NPCCount with only true entries.
Used for methods that take sets as parameters, like NPC.GetHurtByOtherNPCs(bool[]).
 
static bool[] AllowDoorInteraction = Factory.CreateBoolSet()
 Whether or not this NPC can still interact with doors if they use the Vanilla TownNPC aiStyle (AKA aiStyle == 7) but are not actually marked as Town NPCs (AKA npc.townNPC == true). More...
 
static int[] AttackAverageChance = Factory.CreateIntSet(1, 38, 40, 17, 30, 107, 60, 19, 30, 22, 30, 124, 30, 228, 50, 178, 50, 18, 60, 229, 40, 209, 30, 54, 30, 108, 30, 160, 60, 20, 60, 369, 50, 453, 30, 368, 40, 207, 1, 227, 30, 208, 50, 142, 50, 441, 1, 353, 1, 633, 1, 550, 40, 588, 20, 663, 1, 638, 1, 637, 1, 656, 1, 670, 1, 678, 1, 679, 1, 680, 1, 681, 1, 682, 1, 683, 1, 684, 1)
 The chance that this town NPC attacks if it detects danger.
The actual chance is 1 / (retrieved value * 2).
Defaults to 1.
 
static int[] AttackFrameCount = Factory.CreateIntSet(0, 17, 4, 18, 4, 19, 4, 20, 2, 22, 5, 37, 0, 38, 4, 54, 2, 107, 4, 108, 2, 124, 4, 142, 4, 160, 2, 178, 4, 207, 4, 208, 4, 209, 5, 227, 4, 228, 5, 229, 5, 353, 4, 633, 4, 368, 5, 369, 4, 453, 4, 441, 4, 550, 4, 588, 4, 663, 2, 637, 0, 638, 0, 656, 0, 670, 0, 678, 0, 679, 0, 680, 0, 681, 0, 682, 0, 683, 0, 684, 0)
 The number of this town NPC's extra frames that are dedicated to attacking.
Defaults to 0. More...
 
static int[] AttackTime = Factory.CreateIntSet(-1, 38, 34, 17, 34, 107, 60, 19, 40, 22, 30, 124, 34, 228, 40, 178, 24, 18, 34, 229, 60, 209, 60, 54, 60, 108, 30, 160, 60, 20, 600, 369, 34, 453, 34, 368, 60, 207, 15, 227, 60, 208, 34, 142, 34, 441, 15, 353, 12, 633, 12, 550, 34, 588, 20, 663, 60, 638, -1, 637, -1, 656, -1, 670, -1, 678, -1, 679, -1, 680, -1, 681, -1, 682, -1, 683, -1, 684, -1)
 The duration of this town NPC's attack animation in ticks.
Defaults to -1.
 
static int[] AttackType = Factory.CreateIntSet(-1, 38, 0, 17, 0, 107, 0, 19, 1, 22, 1, 124, 0, 228, 1, 178, 1, 18, 0, 229, 1, 209, 1, 54, 2, 108, 2, 160, 2, 20, 2, 369, 0, 453, 0, 368, 1, 207, 3, 227, 1, 208, 0, 142, 0, 441, 3, 353, 3, 633, 0, 550, 0, 588, 0, 663, 2, 638, -1, 637, -1, 656, -1, 670, -1, 678, -1, 679, -1, 680, -1, 681, -1, 682, -1, 683, -1, 684, -1)
 Determines how a town NPC with the given NPC type (NPC.type) attacks. Use the corresponding hooks to implement and customize the attack. For -1, this NPC won't attack. For 0, this NPC will throw a projectile. ModNPC.TownNPCAttackProj(ref int, ref int), ModNPC.TownNPCAttackProjSpeed(ref float, ref float, ref float) For 1, this NPC will shoot a weapon. ModNPC.TownNPCAttackProj(ref int, ref int), ModNPC.TownNPCAttackProjSpeed(ref float, ref float, ref float), ModNPC.TownNPCAttackShoot(ref bool), ModNPC.DrawTownAttackGun(ref Microsoft.Xna.Framework.Graphics.Texture2D, ref Rectangle, ref float, ref int) For 2, this NPC will use magic. ModNPC.TownNPCAttackProj(ref int, ref int), ModNPC.TownNPCAttackProjSpeed(ref float, ref float, ref float), ModNPC.TownNPCAttackMagic(ref float) For 3, this NPC will swing a weapon. ModNPC.TownNPCAttackSwing(ref int, ref int), ModNPC.DrawTownAttackSwing(ref Microsoft.Xna.Framework.Graphics.Texture2D, ref Rectangle, ref int, ref float, ref Vector2) Defaults to -1. More...
 
static bool[] BelongsToInvasionFrostLegion = Factory.CreateBoolSet(143, 144, 145)
 If true for a given NPC type (NPC.type), then that NPC belongs to the Frost Legion invasion.
During the Frost Legion invasion, NPCs in this set will decrement Main.invasionSize by the amount specified in InvasionSlotCount when killed.
If any NPC in this set is alive and InvasionSlotCount is above 0, the Boss 3 music will play.
Defaults to false.
 
static bool[] BelongsToInvasionGoblinArmy = Factory.CreateBoolSet(26, 27, 28, 29, 111, 471, 472)
 If true for a given NPC type (NPC.type), then that NPC belongs to the Goblin Army invasion.
During the Goblin Army invasion, NPCs in this set will decrement Main.invasionSize by the amount specified in InvasionSlotCount when killed.
If any NPC in this set is alive and InvasionSlotCount is above 0, the Goblin Army music will play.
Defaults to false.
 
static bool[] BelongsToInvasionMartianMadness = Factory.CreateBoolSet(381, 382, 383, 385, 386, 387, 388, 389, 390, 391, 395, 520)
 If true for a given NPC type (NPC.type), then that NPC belongs to the Martian Madness invasion.
During the Martian Madness invasion, NPCs in this set will decrement Main.invasionSize by the amount specified in InvasionSlotCount when killed.
If any NPC in this set is alive and InvasionSlotCount is above 0, the Martian Madness music will play.
Defaults to false.
 
static bool[] BelongsToInvasionOldOnesArmy = Factory.CreateBoolSet(552, 553, 554, 561, 562, 563, 555, 556, 557, 558, 559, 560, 576, 577, 568, 569, 566, 567, 570, 571, 572, 573, 548, 549, 564, 565, 574, 575, 551, 578)
 If true for a given NPC type (NPC.type), then that NPC belongs to the Old One's Army event.
If any NPC in this set is alive, the OOA music will play. Additionally, all NPCs in this set will be erased when the OOA ends.
NPCs in this set will target the DD2EterniaCrystal if it is alive (using Utilities.NPCUtils.TargetClosestOldOnesInvasion(NPC, bool, Vector2?)).
Defaults to false.
 
static bool[] BelongsToInvasionPirate = Factory.CreateBoolSet(212, 213, 214, 215, 216, 491)
 If true for a given NPC type (NPC.type), then that NPC belongs to the Pirate invasion.
During the Pirate invasion, NPCs in this set will decrement Main.invasionSize by the amount specified in InvasionSlotCount when killed.
If any NPC in this set is alive and InvasionSlotCount is above 0, the Pirate Invasion music will play.
Defaults to false.
 
static List< int > BossBestiaryPriority
 The order of boss NPC types (NPC.type) in the Bestiary.
 
static int[] BossHeadTextures = Factory.CreateIntSet(-1, 4, 0, 13, 2, 344, 3, 370, 4, 246, 5, 249, 5, 345, 6, 50, 7, 396, 8, 395, 9, 325, 10, 262, 11, 327, 13, 222, 14, 125, 15, 126, 20, 346, 17, 127, 18, 35, 19, 68, 19, 113, 22, 266, 23, 439, 24, 440, 24, 134, 25, 491, 26, 517, 27, 422, 28, 507, 29, 493, 30, 549, 35, 564, 32, 565, 32, 576, 33, 577, 33, 551, 34, 548, 36, 636, 37, 657, 38, 668, 39)
 Associates an NPC type (NPC.type) with the index in GameContent.TextureAssets.NpcHeadBoss of its default map icon.
Auto-set using AutoloadBossHead.
Defaults to -1. More...
 
static bool[] CanConvertIntoCopperSlimeTownNPC = Factory.CreateBoolSet(1, 302, 335, 336, 333, 334)
 If true for a given NPC type (NPC.type), then that NPC can pick up ItemID.CopperShortsword or ItemID.CopperHelmet to become TownSlimeCopper.
Defaults to false.
 
static bool[] CanHitPastShimmer = Factory.CreateBoolSet(535, 5, 13, 14, 15, 666, 267, 36, 210, 211, 115, 116, 117, 118, 119, 658, 659, 660, 134, 135, 136, 139, 128, 131, 129, 130, 263, 264, 246, 249, 247, 248, 371, 372, 373, 566, 567, 440, 522, 523, 521, 454, 455, 456, 457, 458, 459, 397, 396, 400)
 If true for a given NPC type (NPC.type), then that NPC can hit players that are submerged in shimmer.
Defaults to false. More...
 
static bool[] CannotDropSouls = Factory.CreateBoolSet(1, 13, 14, 15, 121, 535)
 Whether or not a given NPC is excluded from dropping hardmode souls (Soul of Night/Light)
Contains vanilla NPCs that are easy to spawn in large numbers, preventing easy soul farming
Do not add your NPC to this if it would be excluded automatically (i.e. critter, town NPC, or no coin drops)
 
static bool[] CannotSitOnFurniture = Factory.CreateBoolSet(638, 656)
 Whether or not a given NPC can sit on suitable furniture (TileID.Sets.CanBeSatOnForNPCs)
 
static bool[] CantTakeLunchMoney = Factory.CreateBoolSet(394, 393, 392, 492, 491, 662, 384, 478, 535, 658, 659, 660, 128, 131, 129, 130, 139, 267, 247, 248, 246, 249, 245, 409, 410, 397, 396, 401, 400, 440, 68, 534)
 If true for a given NPC type (NPC.type), then that NPC cannot pick up dropped coins in Expert Mode.
Defaults to false.
 
static bool[] CountsAsCritter = Factory.CreateBoolSet(46, 303, 337, 540, 443, 74, 297, 298, 442, 611, 377, 446, 612, 613, 356, 444, 595, 596, 597, 598, 599, 600, 601, 604, 605, 357, 448, 374, 484, 355, 358, 606, 359, 360, 485, 486, 487, 148, 149, 55, 230, 592, 593, 299, 538, 539, 300, 447, 361, 445, 362, 363, 364, 365, 367, 366, 583, 584, 585, 602, 603, 607, 608, 609, 610, 616, 617, 625, 626, 627, 615, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 661, 669, 671, 672, 673, 674, 675, 677, 687)
 If true for a given NPC type (NPC.type), then that NPC is counted as a critter.
Critters cannot be damage by players with Player.dontHurtCritters set to true.
Also, critters can't be used to summon Horseman's Blade projectiles, nor can they be chased by said projectiles.
 
static int[] DangerDetectRange = Factory.CreateIntSet(-1, 38, 300, 17, 320, 107, 300, 19, 900, 22, 700, 124, 800, 228, 800, 178, 900, 18, 300, 229, 1000, 209, 1000, 54, 700, 108, 700, 160, 700, 20, 1200, 369, 300, 453, 300, 368, 900, 207, 60, 227, 800, 208, 400, 142, 500, 441, 50, 353, 60, 633, 100, 550, 120, 588, 120, 663, 700, 638, 250, 637, 250, 656, 250, 670, 250, 678, 250, 679, 250, 680, 250, 681, 250, 682, 250, 683, 250, 684, 250)
 The distance, in pixels, that this town NPC will check for enemies to attack. Any enemies beyond this distance are not considered.
Also serves as the attack range for NPCs with an AttackType of 0 or 2.
Defaults to -1, which uses a default of 200 pixels (12.5 tiles). More...
 
static bool[] DangerThatPreventsOtherDangers = Factory.CreateBoolSet(517, 422, 507, 493, 399)
 If true for a given NPC type (NPC.type), then that NPC is considered dangerous without having NPC.boss set.
Main.CurrentFrameFlags.AnyActiveBossNPC will be set to true if any NPC in this set is alive, and NPC.AnyDanger(bool, bool) will return true if any NPCs in this set are alive.
Defaults to false.
 
static bool[] DemonEyes = Factory.CreateBoolSet(2, 190, 192, 193, 191, 194, 317, 318)
 Unused in vanilla.
If true for a given NPC type (NPC.type), then that NPC is a type of demon eye.
Defaults to false.
 
static bool[] DontDoHardmodeScaling = Factory.CreateBoolSet(5, 13, 14, 15, 267, 113, 114, 115, 116, 117, 118, 119, 658, 659, 660, 400, 522)
 If true for a given NPC type (NPC.type), then that NPC will not have its stats increased in Main.expertMode or higher difficulties.
Defaults to false.
 
static int[] ExtraFramesCount = Factory.CreateIntSet(0, 17, 9, 18, 9, 19, 9, 20, 7, 22, 10, 37, 5, 38, 9, 54, 7, 107, 9, 108, 7, 124, 9, 142, 9, 160, 7, 178, 9, 207, 9, 208, 9, 209, 10, 227, 9, 228, 10, 229, 10, 353, 9, 633, 9, 368, 10, 369, 9, 453, 9, 441, 9, 550, 9, 588, 9, 663, 7, 637, 18, 638, 11, 656, 20, 670, 6, 678, 6, 679, 6, 680, 6, 681, 6, 682, 6, 683, 6, 684, 6)
 The number of extra frames this town NPC has. These frames are used for special actions, such as sitting down and talking to other NPCs.
Defaults to 0. More...
 
static int[] ExtraTextureCount = Factory.CreateIntSet(0, 38, 1, 17, 1, 107, 0, 19, 0, 22, 0, 124, 1, 228, 0, 178, 1, 18, 1, 229, 1, 209, 1, 54, 1, 108, 1, 160, 0, 20, 0, 369, 1, 453, 1, 368, 1, 207, 1, 227, 1, 208, 0, 142, 1, 441, 1, 353, 1, 633, 1, 550, 0, 588, 1, 633, 2, 663, 1, 638, 0, 637, 0, 656, 0, 670, 0, 678, 0, 679, 0, 680, 0, 681, 0, 682, 0, 683, 0, 684, 0)
 The number of extra textures this town NPC has.
Most extra textures are hatless versions used for parties, though the BestiaryGirl has an additional transformed texture as well.
Unused in vanilla.
Defaults to 0.
 
static int[] FaceEmote = Factory.CreateIntSet(0, 17, 101, 18, 102, 19, 103, 20, 104, 22, 105, 37, 106, 38, 107, 54, 108, 107, 109, 108, 110, 124, 111, 142, 112, 160, 113, 178, 114, 207, 115, 208, 116, 209, 117, 227, 118, 228, 119, 229, 120, 353, 121, 368, 122, 369, 123, 453, 124, 441, 125, 588, 140, 633, 141, 663, 145)
 Associates a town NPC's NPC type (NPC.type) with its corresponding GameContent.UI.EmoteID.
Town NPCs can emote using emotes in this set if the corresponding NPC is alive.
If 0 for a given NPC type, then that NPC has no associated emote.
Defaults to 0. More...
 
static SetFactory Factory = new SetFactory(NPCLoader.NPCCount)
 
static bool[] FighterUsesDD2PortalAppearEffect = Factory.CreateBoolSet(552, 553, 554, 561, 562, 563, 555, 556, 557, 576, 577, 568, 569, 570, 571, 572, 573, 564, 565)
 If true for a given NPC type (NPC.type), then that NPC will have a special spawning animation when using NPCAIStyleID.DD2Fighter.
Defaults to false.
 
static List< int > GoldCrittersCollection
 A list of all NPC types (NPC.type) categorized as gold critters.
If a gold critter shows up on the Lifeform Analyzer, its name will be gold (Main.DrawInfoAccs_AdjustInfoTextColorsForNPC(NPC, ref Color, ref Color)). More...
 
static bool[] HasNoPartyText = Factory.CreateBoolSet(441, 453)
 Only applies to vanilla NPCs. Also only applies to town NPCs.
If true for a given NPC type (NPC.type), then that NPC doesn't have any special dialogue for parties.
Defaults to false.
 
static int[] HatOffsetY = Factory.CreateIntSet(0, 227, 4, 107, 2, 108, 2, 229, 4, 17, 2, 38, 8, 160, -10, 208, 2, 142, 2, 124, 2, 453, 2, 37, 4, 54, 4, 209, 4, 369, 6, 441, 6, 353, -2, 633, -2, 550, -2, 588, 2, 663, 2, 637, 0, 638, 0, 656, 4, 670, 0, 678, 0, 679, 0, 680, 0, 681, 0, 682, 0, 683, 0, 684, 0)
 The vertical offset, in pixels, that an NPC's party hat will draw with.
Defaults to 0. More...
 
static bool[] HurtingBees = Factory.CreateBoolSet(210, 211, 222)
 If true for a given NPC type (NPC.type), then that NPC is a bee that will hurt other non-bee NPCs on contact.
Defaults to false.
 
static bool[] ImmuneToAllBuffs
 If true, this NPC type (NPC.type) will be immune to all debuffs and "tag" buffs by default.

Use this for special NPCs that cannot be hit at all, such as fairy critters, container NPCs like Martian Saucer and Pirate Ship, bound town slimes, and Blazing Wheel. Dungeon Guardian also is in this set to prevent the bonus damage from "tag" buffs.

If the NPC should be attacked, it is recommended to set ImmuneToRegularBuffs to true instead. This will prevent all debuffs except "tag" buffs (BuffID.Sets.IsATagBuff), which are intended to affect enemies typically seen as immune to all debuffs. Tag debuffs are special debuffs that facilitate combat mechanics, they are not something that adversely affects NPC.

Modders can specify specific buffs to be vulnerable to by assigning SpecificDebuffImmunity to false.
 
static bool[] ImmuneToRegularBuffs
 If true, this NPC type (NPC.type) will be immune to all debuffs except tag debuffs (BuffID.Sets.IsATagBuff) by default.

Use this for NPCs that can be attacked that should be immune to all normal debuffs. Tag debuffs are special debuffs that facilitate combat mechanics, such as the "summon tag damage" applied by whip weapons. Wraith, Reaper, Lunatic Cultist, the Celestial Pillars, The Destroyer, and the Martian Saucer Turret/Cannon/Core are examples of NPCs that use this setting.

Modders can specify specific buffs to be vulnerable to by assigning SpecificDebuffImmunity to false.
 
static int[] InvasionSlotCount = Factory.CreateIntSet(1, 216, 5, 395, 10, 491, 10, 471, 10, 472, 0, 387, 0)
 If above 0 for a given NPC type (NPC.type), and its associated invasion is NOT a wave-based one, then that NPC will decrement Main.invasionSize by that amount when killed.
If this NPC's entry is 0, it won't play its associated invasion's music when alive. More...
 
static bool[] IsDragonfly = Factory.CreateBoolSet(595, 596, 597, 598, 599, 600, 601)
 If true for a given NPC type (NPC.type), then that NPC is categorized as a dragonfly.
Defaults to false. More...
 
static bool[] IsTownPet = Factory.CreateBoolSet(637, 638, 656, 670, 678, 679, 680, 681, 682, 683, 684)
 If true for a given NPC type (NPC.type), then that NPC is categorized as a town pet.
Town pets must have NPC.aiStyle == NPCAIStyleID.Passive to function properly.
Town pets cannot party, can be pet, can be moved into valid rooms even if they contain a stinkbug, and "leave" on death.
Defaults to false.
 
static bool[] IsTownSlime = Factory.CreateBoolSet(670, 678, 679, 680, 681, 682, 683, 684)
 If true for a given NPC type (NPC.type), then that NPC is categorized as a town slime.
Town slimes must have NPC.aiStyle == NPCAIStyleID.Passive to function properly. Additionally, they should also be in the IsTownPet set.
Town slimes cannot sit on chairs, will try to play their idle animations more often, and have horizontally flipped sprites compared to normal town NPCs.
Defaults to false.
 
static Color[] MagicAuraColor = Factory.CreateCustomSet(Color.White, (short)54, new Color(100, 4, 227, 127), (short)108, new Color(255, 80, 60, 127), (short)160, new Color(40, 80, 255, 127), (short)20, new Color(40, 255, 80, 127), (short)663, Main.hslToRgb(0.92f, 1f, 0.78f, 127))
 The Color of the magical aura used by town NPCs with magic (3) attacks.
Defaults to Color.White.
 
static bool[] MPAllowedEnemies = Factory.CreateBoolSet(4, 13, 50, 126, 125, 134, 127, 128, 131, 129, 130, 222, 245, 266, 370, 657, 668)
 If true for a given NPC type (NPC.type), then that NPC can be summoned in multiplayer using MessageID.SpawnBossUseLicenseStartEvent.
If you don't set this, your boss most likely won't work in multiplayer.
Defaults to false.
 
static bool[] MustAlwaysDraw = Factory.CreateBoolSet(113, 114, 115, 116, 126, 125)
 If true for a given NPC type (NPC.type), then that NPC will always draw, even if its hitbox is off-screen.
Default to false.
 
static bool[] NeedsExpertScaling = Factory.CreateBoolSet(25, 30, 665, 33, 112, 666, 261, 265, 371, 516, 519, 397, 396, 398, 491)
 If true for a given NPC type (NPC.type), then that NPC will receive stat scaling in Expert Mode, even if its normal stats would prevent that.
Defaults to false. More...
 
static bool[] NoEarlymodeLootWhenSpawnedFromStatue = Factory.CreateBoolSet(480, 82, 86, 170, 180, 171)
 If true for a given NPC type (NPC.type), then if that NPC was spawned from a statue (NPC.SpawnedFromStatue), it will not drop loot in pre-hardmode.
Defaults to false.
 
static bool[] NoInvasionMusic = Factory.CreateBoolSet(387)
 If true for a given NPC type (NPC.type), then that NPC will not play its associated invasion music.
By default, alive NPCs in any BelongsToInvasion set will automatically play the associated invasion music if InvasionSlotCount is above 0.
Defaults to false.
 
static bool[] NoMultiplayerSmoothingByAI = Factory.CreateBoolSet(6, 8, 37)
 If true for a given NPCAIStyleID (NPC.aiStyle), then that AI style will not smooth its visual position in multiplayer.
Defaults to false. More...
 
static bool[] NoMultiplayerSmoothingByType = Factory.CreateBoolSet(113, 114, 50, 657, 120, 245, 247, 248, 246, 370, 222, 398, 397, 396, 400, 401, 668, 70)
 If true for a given NPC type (NPC.type), then that NPC will not smooth its visual position in multiplayer.
Defaults to false. More...
 
static List< int > NormalGoldCritterBestiaryPriority
 The order of critter NPC types (NPC.type) in the Bestiary.
 
static bool[] NoTownNPCHappiness = Factory.CreateBoolSet(37, 368, 453)
 If true, the given NPC will not count towards town NPC happiness and won't have a happiness button. Pets (NPCID.Sets.IsTownPet) do not need to set this.
 
static Dictionary< int, NPCBestiaryDrawModifiersNPCBestiaryDrawOffset = NPCBestiaryDrawOffsetCreation()
 The settings to use for a given NPC type's (NPC.type) Bestiary drawing.
 
static int[] NPCFramingGroup = Factory.CreateIntSet(0, 18, 1, 20, 1, 208, 1, 178, 1, 124, 1, 353, 1, 633, 1, 369, 2, 160, 3, 637, 4, 638, 5, 656, 6, 670, 7, 678, 7, 679, 7, 680, 7, 681, 7, 682, 7, 683, 7, 684, 7)
 The index for TownNPCsFramingGroups for a given NPC type (NPC.type). See TownNPCsFramingGroups for more info.
Defaults to 0.
 
static bool[] PositiveNPCTypesExcludedFromDeathTally = Factory.CreateBoolSet(121, 384, 478, 479, 410, 472, 378)
 If true for a given NPC type (NPC.type), then that NPC will not have its kills counted.
Used in vanilla for special projectile-like NPCs (not found in ProjectileNPC), for NPCs that turn into another NPC on death, and for temporary NPCs, like the MothronEgg.
Defaults to false. More...
 
static int[] PrettySafe = Factory.CreateIntSet(-1, 19, 300, 22, 200, 124, 200, 228, 300, 178, 300, 229, 300, 209, 300, 54, 100, 108, 100, 160, 100, 20, 200, 368, 200, 227, 200)
 The maximum distance in pixels that an enemy can be from this town NPC before they try to attack.
Defaults to -1.
 
static bool[] ProjectileNPC = Factory.CreateBoolSet(25, 30, 665, 33, 112, 666, 261, 265, 371, 516, 519)
 If true for a given NPC type (NPC.type), then that NPC is treated specially for difficulty scaling.
Projectile NPCs never scale their max health, defense, or value.
Additionally, kills are not counted for NPCs in this set.
Defaults to false.
 
static bool[] ReflectStarShotsInForTheWorthy = Factory.CreateBoolSet(4, 5, 13, 14, 15, 266, 267, 35, 36, 113, 114, 115, 116, 117, 118, 119, 125, 126, 134, 135, 136, 139, 127, 128, 131, 129, 130, 262, 263, 264, 245, 247, 248, 246, 249, 398, 400, 397, 396, 401)
 If true for a given NPC type (NPC.type), then that NPC will reflect ProjectileID.StarCannonStar and ProjectileID.SuperStar on the "For the Worthy" secret seed.
Defaults to false.
 
static Dictionary< int, int > RespawnEnemyID
 Associates an NPC type (NPC.type) with the NPC type it respawns as from the coin loss system (GameContent.CoinLossRevengeSystem).
If an NPC type is not a key in this dictionary, then that NPC respawns as itself.
If the value for an NPC type is 0, then that NPC won't be cached (GameContent.CoinLossRevengeSystem.CacheEnemy(NPC)).
 
static bool[] ShimmerTownTransform = Factory.CreateBoolSet(22, 17, 18, 227, 207, 633, 588, 208, 369, 353, 38, 20, 550, 19, 107, 228, 54, 124, 441, 229, 160, 108, 178, 209, 142, 663, 37, 453, 368)
 If true for a given NPC type (NPC.type), then that NPC is a town NPC with an alternate shimmered texture.
Defaults to false.
 
static int[] ShimmerTransformToItem = Factory.CreateIntSet(-1, 651, 182, 644, 182, 650, 178, 643, 178, 649, 179, 642, 179, 648, 177, 641, 177, 640, 180, 647, 180, 646, 181, 639, 181, 652, 999, 645, 999, 448, 5341)
 If not -1 for a given NPC type (NPC.type), then that NPC will transform into the retrieved item type (Item.type) when touching shimmer.
Defaults to -1. More...
 
static int[] ShimmerTransformToNPC = Factory.CreateIntSet(-1, 3, 21, 132, 202, 186, 201, 187, 21, 188, 21, 189, 202, 200, 203, 590, 21, 1, 676, 302, 676, 335, 676, 336, 676, 334, 676, 333, 676, 225, 676, 141, 676, 16, 676, 147, 676, 184, 676, 537, 676, 204, 676, 81, 676, 183, 676, 138, 676, 121, 676, 591, 449, 430, 449, 436, 452, 432, 450, 433, 449, 434, 449, 435, 451, 614, 677, 74, 677, 297, 677, 298, 677, 673, 677, 672, 677, 671, 677, 675, 677, 674, 677, 362, 677, 363, 677, 364, 677, 365, 677, 608, 677, 609, 677, 602, 677, 603, 677, 611, 677, 148, 677, 149, 677, 46, 677, 303, 677, 337, 677, 299, 677, 538, 677, 55, 677, 607, 677, 615, 677, 625, 677, 626, 677, 361, 677, 687, 677, 484, 677, 604, 677, 358, 677, 355, 677, 616, 677, 617, 677, 654, 677, 653, 677, 655, 677, 585, 677, 584, 677, 583, 677, 595, 677, 596, 677, 600, 677, 597, 677, 598, 677, 599, 677, 357, 677, 377, 677, 606, 677, 359, 677, 360, 677, 367, 677, 366, 677, 300, 677, 610, 677, 612, 677, 487, 677, 486, 677, 485, 677, 669, 677, 356, 677, 661, 677, 374, 677, 442, 677, 443, 677, 444, 677, 601, 677, 445, 677, 592, 677, 446, 677, 605, 677, 447, 677, 627, 677, 539, 677, 613, 677)
 Associates an NPC type (NPC.type) with the NPC type it will turn into when submerged in shimmer.
A value of<c>-1 means the given NPC won't transform.
Defaults to -1.
Also applies to transforming critter items (Item.makeNPC > 0) into NPC.
 
static bool[] ShouldBeCountedAsBoss = Factory.CreateBoolSet(false, 517, 422, 507, 493, 13, 664)
 If true for a given NPC type (NPC.type), then that NPC is sorted with bosses despite NPC.boss being false.
Used in vanilla for the Celestial Pillars, the Eater of Worlds' head, and the Torch God.
Defaults to false.
 
static bool[] Skeletons = Factory.CreateBoolSet(77, 449, 450, 451, 452, 481, 201, 202, 203, 21, 324, 110, 323, 293, 291, 322, 292, 197, 167, 44, 635)
 If true for a given NPC type (NPC.type), then that NPC is a type of skeleton.
Skeletons cannot hurt the SkeletonMerchant.
Defaults to false.
 
static bool[] SpawnFromLastEmptySlot = Factory.CreateBoolSet(222, 245)
 Whether or not the spawned NPC will start looking for a suitable slot from the end of

See also
Main.npc

, ignoring the Start parameter of NPC.NewNPC. Useful if you have a multi-segmented boss and want its parts to draw over the main body (body will be in this set).

 
static bool[] SpawnsWithCustomName = Factory.CreateBoolSet(453)
 Whether or not a given NPC will spawn with a custom name like a town NPC. In order to determine what name will be selected, override the TownNPCName hook. True will force a name to be rolled regardless of vanilla behavior. False will have vanilla handle the naming.
 
static Dictionary< int, int > SpecialSpawningRules
 Determines the special spawning rules for an NPC to use when respawning using the coin loss system (GameContent.CoinLossRevengeSystem).
If 0 for a given NPC type (NPC.type), then NPC.ai[0] and NPC.ai[1] are set to this NPC's position in tile coordinates. More...
 
static ? bool[][] SpecificDebuffImmunity
 Indexed by NPC type and then Buff type. If true, this NPC type (NPC.type) will be immune (NPC.buffImmune) to the specified buff type. If false, the NPC will not be immune.

By default, NPCs aren't immune to any buffs, but ImmuneToRegularBuffs or ImmuneToAllBuffs can make an NPC immune to all buffs. The values in this set override those settings.

Additionally, the effects of BuffID.Sets.GrantImmunityWith will also be applied. Inherited buff immunities do not need to be specifically assigned, as they will be automatically applied. Setting an inherited debuff to false in this set can be used to undo the effects of BuffID.Sets.GrantImmunityWith, if needed.

Defaults to null, indicating no immunity override.

 
static float[] StatueSpawnedDropRarity = Factory.CreateCustomSet(-1f, (short)480, 0.05f, (short)82, 0.05f, (short)86, 0.05f, (short)48, 0.05f, (short)490, 0.05f, (short)489, 0.05f, (short)170, 0.05f, (short)180, 0.05f, (short)171, 0.05f, (short)167, 0.25f, (short)73, 0.01f, (short)24, 0.05f, (short)481, 0.05f, (short)42, 0.05f, (short)6, 0.05f, (short)2, 0.05f, (short)49, 0.2f, (short)3, 0.2f, (short)58, 0.2f, (short)21, 0.2f, (short)65, 0.2f, (short)449, 0.2f, (short)482, 0.2f, (short)103, 0.2f, (short)64, 0.2f, (short)63, 0.2f, (short)85, 0f)
 If != -1f for a given NPC type (NPC.type), then if that NPC was spawned from a statue (NPC.SpawnedFromStatue), it will have a (retrieved value)% chance to actually drop loot when killed.
Defaults to -1f. More...
 
static bool[] TakesDamageFromHostilesWithoutBeingFriendly = Factory.CreateBoolSet(46, 55, 74, 148, 149, 230, 297, 298, 299, 303, 355, 356, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 377, 357, 374, 442, 443, 444, 445, 446, 448, 538, 539, 337, 540, 484, 485, 486, 487, 592, 593, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 611, 612, 613, 614, 615, 616, 617, 625, 626, 627, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 583, 584, 585, 669, 671, 672, 673, 674, 675, 677, 687)
 If true for a given NPC type (NPC.type), then that NPC can take damage from hostile NPCs without being friendly.
Used in vanilla for critters and trapped town slimes.
Defaults to false.
 
static bool[] TeleportationImmune = Factory.CreateBoolSet(552, 553, 554, 561, 562, 563, 555, 556, 557, 558, 559, 560, 576, 577, 568, 569, 566, 567, 570, 571, 572, 573, 548, 549, 564, 565, 574, 575, 551, 578)
 If true for a given NPC type (NPC.type), then that NPC cannot be teleported using TileID.Teleporters.
Defaults to false. More...
 
static bool[] TownCritter = Factory.CreateBoolSet(46, 148, 149, 230, 299, 300, 303, 337, 361, 362, 364, 366, 367, 443, 445, 447, 538, 539, 540, 583, 584, 585, 592, 593, 602, 607, 608, 610, 616, 617, 625, 626, 627, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 687)
 If true for a given NPC type (NPC.type), then that NPC is a critter that can spawn in towns.
Town critters use NPCAIStyleID.Passive.
Defaults to false. More...
 
static List< int > TownNPCBestiaryPriority
 The order of town NPC NPC types (NPC.type) in the Bestiary.
 
static int[][] TownNPCsFramingGroups
 The vertical offset, in pixels, that this NPC's party hat will draw. Indexed using values from NPCFramingGroup. More...
 
static int[] TrailCacheLength = Factory.CreateIntSet(10, 402, 36, 519, 20, 522, 20, 620, 20, 677, 60, 685, 10)
 The length of this NPC type's (NPC.type) NPC.oldPos and NPC.oldRot arrays.
This set does nothing by itself. You will need to set TrailingMode in order to actually store values.
Defaults to 10.
 
static int[] TrailingMode = Factory.CreateIntSet(-1, 439, 0, 440, 0, 370, 1, 372, 1, 373, 1, 396, 1, 400, 1, 401, 1, 473, 2, 474, 2, 475, 2, 476, 2, 4, 3, 471, 3, 477, 3, 479, 3, 120, 4, 137, 4, 138, 4, 94, 5, 125, 6, 126, 6, 127, 6, 128, 6, 129, 6, 130, 6, 131, 6, 139, 6, 140, 6, 407, 6, 420, 6, 425, 6, 427, 6, 426, 6, 581, 6, 516, 6, 542, 6, 543, 6, 544, 6, 545, 6, 402, 7, 417, 7, 419, 7, 418, 7, 574, 7, 575, 7, 519, 7, 521, 7, 522, 7, 546, 7, 558, 7, 559, 7, 560, 7, 551, 7, 620, 7, 657, 6, 636, 7, 677, 7, 685, 7)
 If != -1 for a given NPC type (NPC.type), then that NPC will store its past positions (and potentially more) for use in a trail.
A value of 0 will store the NPC's position in NPC.oldPos every three frames. Vanilla automatically uses NPC.localAI[3] to count frames for this, so make sure your code doesn't interfere with that.
A value of 1, 5, or 6 will store the NPC's position in NPC.oldPos every frame.
A value of 2 will store the NPC's position and rotation in NPC.oldPos and NPC.oldRot respectively every frame if NPC.ai[0] == 4 or 5 or 6.
A value of 3 or 7 will store the NPC's position and rotation in NPC.oldPos and NPC.oldRot respectively every frame.
A value of 4 will store the NPC's position in NPC.oldPos every frame, as well as creating light (0x4D0033) at the NPC's position.
Other values will do nothing.
Vanilla will not automatically draw trails for you.
Defaults to -1. More...
 
static bool[] UsesMultiplayerProximitySyncing = Factory.CreateBoolSet(true, 398, 397, 396)
 If true for a given NPC type (NPC.type), then that NPC will sync more the closer it is to a player.
Defaults to true.
 
static bool[] UsesNewTargetting = Factory.CreateBoolSet(547, 552, 553, 554, 561, 562, 563, 555, 556, 557, 558, 559, 560, 576, 577, 568, 569, 566, 567, 570, 571, 572, 573, 564, 565, 574, 575, 551, 578, 210, 211, 620, 668)
 If true for a given NPC type (NPC.type), then that NPC can target other NPCs.
This set does not automatically handle NPC targeting. You should use Utilities.NPCUtils.SearchForTarget(NPC, Utilities.NPCUtils.TargetSearchFlag, Utilities.NPCUtils.SearchFilter<Player>, Utilities.NPCUtils.SearchFilter<NPC>) or any of its overloads to write your own targeting function.
Defaults to false. More...
 
static bool[] ZappingJellyfish = Factory.CreateBoolSet(63, 64, 103, 242)
 If true for a given NPC type (NPC.type), then that NPC, if currently NPC.dontTakeDamage, will damage the player when hit with a melee attack, a whip, certain ProjAIStyleIDs (ProjAIStyleID.Spear, ProjAIStyleID.ShortSword, ProjAIStyleID.SleepyOctopod, ProjAIStyleID.HeldProjectile), or by any projectile type (Projectile.type) in the ProjectileID.Sets.AllowsContactDamageFromJellyfish or ProjectileID.Sets.IsAWhip sets.
Defaults to false.
 
static bool[] Zombies = Factory.CreateBoolSet(3, 132, 186, 187, 188, 189, 200, 223, 161, 254, 255, 52, 53, 536, 319, 320, 321, 332, 436, 431, 432, 433, 434, 435, 331, 430, 590)
 Unused in vanilla.
If true for a given NPC type (NPC.type), then that NPC is a type of zombie.
Defaults to false.
 

Member Data Documentation

◆ AllowDoorInteraction

bool [] NPCID.Sets.AllowDoorInteraction = Factory.CreateBoolSet()
static

Whether or not this NPC can still interact with doors if they use the Vanilla TownNPC aiStyle (AKA aiStyle == 7) but are not actually marked as Town NPCs (AKA npc.townNPC == true).

Note: This set DOES NOT DO ANYTHING if your NPC doesn't use the Vanilla TownNPC aiStyle (aiStyle == 7).

◆ AttackFrameCount

int [] NPCID.Sets.AttackFrameCount = Factory.CreateIntSet(0, 17, 4, 18, 4, 19, 4, 20, 2, 22, 5, 37, 0, 38, 4, 54, 2, 107, 4, 108, 2, 124, 4, 142, 4, 160, 2, 178, 4, 207, 4, 208, 4, 209, 5, 227, 4, 228, 5, 229, 5, 353, 4, 633, 4, 368, 5, 369, 4, 453, 4, 441, 4, 550, 4, 588, 4, 663, 2, 637, 0, 638, 0, 656, 0, 670, 0, 678, 0, 679, 0, 680, 0, 681, 0, 682, 0, 683, 0, 684, 0)
static

The number of this town NPC's extra frames that are dedicated to attacking.
Defaults to 0.

If you want to copy a vanilla NPC's framing, use ModNPC.AnimationType.

◆ AttackType

int [] NPCID.Sets.AttackType = Factory.CreateIntSet(-1, 38, 0, 17, 0, 107, 0, 19, 1, 22, 1, 124, 0, 228, 1, 178, 1, 18, 0, 229, 1, 209, 1, 54, 2, 108, 2, 160, 2, 20, 2, 369, 0, 453, 0, 368, 1, 207, 3, 227, 1, 208, 0, 142, 0, 441, 3, 353, 3, 633, 0, 550, 0, 588, 0, 663, 2, 638, -1, 637, -1, 656, -1, 670, -1, 678, -1, 679, -1, 680, -1, 681, -1, 682, -1, 683, -1, 684, -1)
static

Determines how a town NPC with the given NPC type (NPC.type) attacks. Use the corresponding hooks to implement and customize the attack. For -1, this NPC won't attack. For 0, this NPC will throw a projectile. ModNPC.TownNPCAttackProj(ref int, ref int), ModNPC.TownNPCAttackProjSpeed(ref float, ref float, ref float) For 1, this NPC will shoot a weapon. ModNPC.TownNPCAttackProj(ref int, ref int), ModNPC.TownNPCAttackProjSpeed(ref float, ref float, ref float), ModNPC.TownNPCAttackShoot(ref bool), ModNPC.DrawTownAttackGun(ref Microsoft.Xna.Framework.Graphics.Texture2D, ref Rectangle, ref float, ref int) For 2, this NPC will use magic. ModNPC.TownNPCAttackProj(ref int, ref int), ModNPC.TownNPCAttackProjSpeed(ref float, ref float, ref float), ModNPC.TownNPCAttackMagic(ref float) For 3, this NPC will swing a weapon. ModNPC.TownNPCAttackSwing(ref int, ref int), ModNPC.DrawTownAttackSwing(ref Microsoft.Xna.Framework.Graphics.Texture2D, ref Rectangle, ref int, ref float, ref Vector2) Defaults to -1.

You can modify most aspects of a town NPC's attack, including the item used and projectile shot, using any of the "TownNPCAttack" or "TownAttack" hooks in ModNPC or GlobalNPC.
You can change the color of a magic (2) NPC's aura using MagicAuraColor.

◆ BossHeadTextures

int [] NPCID.Sets.BossHeadTextures = Factory.CreateIntSet(-1, 4, 0, 13, 2, 344, 3, 370, 4, 246, 5, 249, 5, 345, 6, 50, 7, 396, 8, 395, 9, 325, 10, 262, 11, 327, 13, 222, 14, 125, 15, 126, 20, 346, 17, 127, 18, 35, 19, 68, 19, 113, 22, 266, 23, 439, 24, 440, 24, 134, 25, 491, 26, 517, 27, 422, 28, 507, 29, 493, 30, 549, 35, 564, 32, 565, 32, 576, 33, 577, 33, 551, 34, 548, 36, 636, 37, 657, 38, 668, 39)
static

Associates an NPC type (NPC.type) with the index in GameContent.TextureAssets.NpcHeadBoss of its default map icon.
Auto-set using AutoloadBossHead.
Defaults to -1.

If you need to dynamically change your boss's head icon, use ModNPC.BossHeadSlot(ref int) and NPCHeadLoader.GetBossHeadSlot(string).
If you need an NPC's current head index, using NPC.GetBossHeadTextureIndex, which handles phase changes.

◆ CanHitPastShimmer

bool [] NPCID.Sets.CanHitPastShimmer = Factory.CreateBoolSet(535, 5, 13, 14, 15, 666, 267, 36, 210, 211, 115, 116, 117, 118, 119, 658, 659, 660, 134, 135, 136, 139, 128, 131, 129, 130, 263, 264, 246, 249, 247, 248, 371, 372, 373, 566, 567, 440, 522, 523, 521, 454, 455, 456, 457, 458, 459, 397, 396, 400)
static

If true for a given NPC type (NPC.type), then that NPC can hit players that are submerged in shimmer.
Defaults to false.

Bosses (NPC.boss) and invasion enemies (NPC.GetNPCInvasionGroup(int)) can always hit shimmered players.

◆ DangerDetectRange

int [] NPCID.Sets.DangerDetectRange = Factory.CreateIntSet(-1, 38, 300, 17, 320, 107, 300, 19, 900, 22, 700, 124, 800, 228, 800, 178, 900, 18, 300, 229, 1000, 209, 1000, 54, 700, 108, 700, 160, 700, 20, 1200, 369, 300, 453, 300, 368, 900, 207, 60, 227, 800, 208, 400, 142, 500, 441, 50, 353, 60, 633, 100, 550, 120, 588, 120, 663, 700, 638, 250, 637, 250, 656, 250, 670, 250, 678, 250, 679, 250, 680, 250, 681, 250, 682, 250, 683, 250, 684, 250)
static

The distance, in pixels, that this town NPC will check for enemies to attack. Any enemies beyond this distance are not considered.
Also serves as the attack range for NPCs with an AttackType of 0 or 2.
Defaults to -1, which uses a default of 200 pixels (12.5 tiles).

PrettySafe determines an NPC's attack range.

◆ ExtraFramesCount

int [] NPCID.Sets.ExtraFramesCount = Factory.CreateIntSet(0, 17, 9, 18, 9, 19, 9, 20, 7, 22, 10, 37, 5, 38, 9, 54, 7, 107, 9, 108, 7, 124, 9, 142, 9, 160, 7, 178, 9, 207, 9, 208, 9, 209, 10, 227, 9, 228, 10, 229, 10, 353, 9, 633, 9, 368, 10, 369, 9, 453, 9, 441, 9, 550, 9, 588, 9, 663, 7, 637, 18, 638, 11, 656, 20, 670, 6, 678, 6, 679, 6, 680, 6, 681, 6, 682, 6, 683, 6, 684, 6)
static

The number of extra frames this town NPC has. These frames are used for special actions, such as sitting down and talking to other NPCs.
Defaults to 0.

If you want to copy a vanilla NPC's framing, use ModNPC.AnimationType.

◆ FaceEmote

int [] NPCID.Sets.FaceEmote = Factory.CreateIntSet(0, 17, 101, 18, 102, 19, 103, 20, 104, 22, 105, 37, 106, 38, 107, 54, 108, 107, 109, 108, 110, 124, 111, 142, 112, 160, 113, 178, 114, 207, 115, 208, 116, 209, 117, 227, 118, 228, 119, 229, 120, 353, 121, 368, 122, 369, 123, 453, 124, 441, 125, 588, 140, 633, 141, 663, 145)
static

Associates a town NPC's NPC type (NPC.type) with its corresponding GameContent.UI.EmoteID.
Town NPCs can emote using emotes in this set if the corresponding NPC is alive.
If 0 for a given NPC type, then that NPC has no associated emote.
Defaults to 0.

This only applies to town NPCs – there isn't a set that associates, say, the Eye of Cthulhu to an associated emote.

◆ GoldCrittersCollection

List<int> NPCID.Sets.GoldCrittersCollection
static
Initial value:
= new List<int> {
443,
442,
592,
593,
444,
601,
445,
446,
605,
447,
627,
613,
448,
539
}

A list of all NPC types (NPC.type) categorized as gold critters.
If a gold critter shows up on the Lifeform Analyzer, its name will be gold (Main.DrawInfoAccs_AdjustInfoTextColorsForNPC(NPC, ref Color, ref Color)).

◆ HatOffsetY

int [] NPCID.Sets.HatOffsetY = Factory.CreateIntSet(0, 227, 4, 107, 2, 108, 2, 229, 4, 17, 2, 38, 8, 160, -10, 208, 2, 142, 2, 124, 2, 453, 2, 37, 4, 54, 4, 209, 4, 369, 6, 441, 6, 353, -2, 633, -2, 550, -2, 588, 2, 663, 2, 637, 0, 638, 0, 656, 4, 670, 0, 678, 0, 679, 0, 680, 0, 681, 0, 682, 0, 683, 0, 684, 0)
static

The vertical offset, in pixels, that an NPC's party hat will draw with.
Defaults to 0.

TownNPCsFramingGroups applies a specific offset per frame, this applies the same offset to all frames.

◆ InvasionSlotCount

int [] NPCID.Sets.InvasionSlotCount = Factory.CreateIntSet(1, 216, 5, 395, 10, 491, 10, 471, 10, 472, 0, 387, 0)
static

If above 0 for a given NPC type (NPC.type), and its associated invasion is NOT a wave-based one, then that NPC will decrement Main.invasionSize by that amount when killed.
If this NPC's entry is 0, it won't play its associated invasion's music when alive.

Note: Even though this defaults to 1, this set should only be checked if NPC.GetNPCInvasionGroup(int) is above 0 or if any BelongsToInvasion sets are true.

◆ IsDragonfly

bool [] NPCID.Sets.IsDragonfly = Factory.CreateBoolSet(595, 596, 597, 598, 599, 600, 601)
static

If true for a given NPC type (NPC.type), then that NPC is categorized as a dragonfly.
Defaults to false.

Vanilla only uses this set to ensure the ItemID.DragonflyStatue doesn't spawn too many dragonflies without checking each type individually. It's still recommended to add your NPC to this set if it applies.

◆ NeedsExpertScaling

bool [] NPCID.Sets.NeedsExpertScaling = Factory.CreateBoolSet(25, 30, 665, 33, 112, 666, 261, 265, 371, 516, 519, 397, 396, 398, 491)
static

If true for a given NPC type (NPC.type), then that NPC will receive stat scaling in Expert Mode, even if its normal stats would prevent that.
Defaults to false.

NPCs with less than 5 health are most prone to needing this set. The full scaling conditions can be found at the start of NPC.ScaleStats(int?, GameModeData, float?).

◆ NoMultiplayerSmoothingByAI

bool [] NPCID.Sets.NoMultiplayerSmoothingByAI = Factory.CreateBoolSet(6, 8, 37)
static

If true for a given NPCAIStyleID (NPC.aiStyle), then that AI style will not smooth its visual position in multiplayer.
Defaults to false.

To prevent smoothing by NPC type (NPC.type), use NoMultiplayerSmoothingByType.

◆ NoMultiplayerSmoothingByType

bool [] NPCID.Sets.NoMultiplayerSmoothingByType = Factory.CreateBoolSet(113, 114, 50, 657, 120, 245, 247, 248, 246, 370, 222, 398, 397, 396, 400, 401, 668, 70)
static

If true for a given NPC type (NPC.type), then that NPC will not smooth its visual position in multiplayer.
Defaults to false.

To prevent smoothing by NPCAIStyleID (NPC.aiStyle), use NoMultiplayerSmoothingByAI.

◆ PositiveNPCTypesExcludedFromDeathTally

bool [] NPCID.Sets.PositiveNPCTypesExcludedFromDeathTally = Factory.CreateBoolSet(121, 384, 478, 479, 410, 472, 378)
static

If true for a given NPC type (NPC.type), then that NPC will not have its kills counted.
Used in vanilla for special projectile-like NPCs (not found in ProjectileNPC), for NPCs that turn into another NPC on death, and for temporary NPCs, like the MothronEgg.
Defaults to false.

Any NPC in the ProjectileNPC set will not have its kills counted either.

◆ ShimmerTransformToItem

int [] NPCID.Sets.ShimmerTransformToItem = Factory.CreateIntSet(-1, 651, 182, 644, 182, 650, 178, 643, 178, 649, 179, 642, 179, 648, 177, 641, 177, 640, 180, 647, 180, 646, 181, 639, 181, 652, 999, 645, 999, 448, 5341)
static

If not -1 for a given NPC type (NPC.type), then that NPC will transform into the retrieved item type (Item.type) when touching shimmer.
Defaults to -1.

The created item will always have a stack of 1.

◆ SpecialSpawningRules

Dictionary<int, int> NPCID.Sets.SpecialSpawningRules
static
Initial value:
= new Dictionary<int, int> {
{ 259, 0 },
{ 260, 0 },
{ 175, 0 },
{ 43, 0 },
{ 56, 0 },
{ 101, 0 }
}

Determines the special spawning rules for an NPC to use when respawning using the coin loss system (GameContent.CoinLossRevengeSystem).
If 0 for a given NPC type (NPC.type), then NPC.ai[0] and NPC.ai[1] are set to this NPC's position in tile coordinates.

All vanilla entries in this set use 0. All vanilla entries in this set are tethered to tiles (ManEater, Snatcher, etc.).

◆ StatueSpawnedDropRarity

float [] NPCID.Sets.StatueSpawnedDropRarity = Factory.CreateCustomSet(-1f, (short)480, 0.05f, (short)82, 0.05f, (short)86, 0.05f, (short)48, 0.05f, (short)490, 0.05f, (short)489, 0.05f, (short)170, 0.05f, (short)180, 0.05f, (short)171, 0.05f, (short)167, 0.25f, (short)73, 0.01f, (short)24, 0.05f, (short)481, 0.05f, (short)42, 0.05f, (short)6, 0.05f, (short)2, 0.05f, (short)49, 0.2f, (short)3, 0.2f, (short)58, 0.2f, (short)21, 0.2f, (short)65, 0.2f, (short)449, 0.2f, (short)482, 0.2f, (short)103, 0.2f, (short)64, 0.2f, (short)63, 0.2f, (short)85, 0f)
static

If != -1f for a given NPC type (NPC.type), then if that NPC was spawned from a statue (NPC.SpawnedFromStatue), it will have a (retrieved value)% chance to actually drop loot when killed.
Defaults to -1f.

NPCs in this set will never drop loot unless interacted with by a player (NPC.AnyInteractions).

◆ TeleportationImmune

bool [] NPCID.Sets.TeleportationImmune = Factory.CreateBoolSet(552, 553, 554, 561, 562, 563, 555, 556, 557, 558, 559, 560, 576, 577, 568, 569, 566, 567, 570, 571, 572, 573, 548, 549, 564, 565, 574, 575, 551, 578)
static

If true for a given NPC type (NPC.type), then that NPC cannot be teleported using TileID.Teleporters.
Defaults to false.

Bosses and tile-phasing (NPC.noTileCollide) NPCs can't be teleported at all, regardless of this set.

◆ TownCritter

bool [] NPCID.Sets.TownCritter = Factory.CreateBoolSet(46, 148, 149, 230, 299, 300, 303, 337, 361, 362, 364, 366, 367, 443, 445, 447, 538, 539, 540, 583, 584, 585, 592, 593, 602, 607, 608, 610, 616, 617, 625, 626, 627, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 687)
static

If true for a given NPC type (NPC.type), then that NPC is a critter that can spawn in towns.
Town critters use NPCAIStyleID.Passive.
Defaults to false.

Make sure to also set CountsAsCritter for NPCs in this set.

◆ TownNPCsFramingGroups

int [][] NPCID.Sets.TownNPCsFramingGroups
static

The vertical offset, in pixels, that this NPC's party hat will draw. Indexed using values from NPCFramingGroup.

HatOffsetY applies the same offset to all frames, this applies a specific offset per frame.

◆ TrailingMode

int [] NPCID.Sets.TrailingMode = Factory.CreateIntSet(-1, 439, 0, 440, 0, 370, 1, 372, 1, 373, 1, 396, 1, 400, 1, 401, 1, 473, 2, 474, 2, 475, 2, 476, 2, 4, 3, 471, 3, 477, 3, 479, 3, 120, 4, 137, 4, 138, 4, 94, 5, 125, 6, 126, 6, 127, 6, 128, 6, 129, 6, 130, 6, 131, 6, 139, 6, 140, 6, 407, 6, 420, 6, 425, 6, 427, 6, 426, 6, 581, 6, 516, 6, 542, 6, 543, 6, 544, 6, 545, 6, 402, 7, 417, 7, 419, 7, 418, 7, 574, 7, 575, 7, 519, 7, 521, 7, 522, 7, 546, 7, 558, 7, 559, 7, 560, 7, 551, 7, 620, 7, 657, 6, 636, 7, 677, 7, 685, 7)
static

If != -1 for a given NPC type (NPC.type), then that NPC will store its past positions (and potentially more) for use in a trail.
A value of 0 will store the NPC's position in NPC.oldPos every three frames. Vanilla automatically uses NPC.localAI[3] to count frames for this, so make sure your code doesn't interfere with that.
A value of 1, 5, or 6 will store the NPC's position in NPC.oldPos every frame.
A value of 2 will store the NPC's position and rotation in NPC.oldPos and NPC.oldRot respectively every frame if NPC.ai[0] == 4 or 5 or 6.
A value of 3 or 7 will store the NPC's position and rotation in NPC.oldPos and NPC.oldRot respectively every frame.
A value of 4 will store the NPC's position in NPC.oldPos every frame, as well as creating light (0x4D0033) at the NPC's position.
Other values will do nothing.
Vanilla will not automatically draw trails for you.
Defaults to -1.

The length of an NPC's trail is determined by TrailCacheLength.

◆ UsesNewTargetting

bool [] NPCID.Sets.UsesNewTargetting = Factory.CreateBoolSet(547, 552, 553, 554, 561, 562, 563, 555, 556, 557, 558, 559, 560, 576, 577, 568, 569, 566, 567, 570, 571, 572, 573, 564, 565, 574, 575, 551, 578, 210, 211, 620, 668)
static

If true for a given NPC type (NPC.type), then that NPC can target other NPCs.
This set does not automatically handle NPC targeting. You should use Utilities.NPCUtils.SearchForTarget(NPC, Utilities.NPCUtils.TargetSearchFlag, Utilities.NPCUtils.SearchFilter<Player>, Utilities.NPCUtils.SearchFilter<NPC>) or any of its overloads to write your own targeting function.
Defaults to false.

You can check if an NPC is in this set using NPC.SupportsNPCTargets.
You can use NPC.GetTargetData(bool) to get info about a target, regardless of if that target is a Player or NPC.