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

◆ AttackType

int [] Terraria.ID.NPCID.Sets.AttackType
static

Determines how a town NPC with the given NPC type (F:Terraria.NPC.type) attacks.
For -1, this NPC won't attack.
For 0, this NPC will throw a projectile.
For 1, this NPC will shoot a weapon.
For 2, this NPC will use magic.
For 3, this NPC will swing a weapon.
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 T:Terraria.ModLoader.ModNPC or T:Terraria.ModLoader.GlobalNPC.
You can change the color of a magic (2) NPC's aura using F:Terraria.ID.NPCID.Sets.MagicAuraColor.

Definition at line 518 of file NPCID.cs.

Referenced by Terraria.ID.NPCID.Sets.Sets(), Terraria.GameContent.Skies.CreditsRoll.CreditsRollComposer.AddWavingNPC(), Terraria.NPC.AI_007_TownEntities(), and Terraria.Main.DrawNPCExtras().