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

◆ GetFullnameByID()

static string Terraria.NPC.GetFullnameByID ( int npcID)
inlinestatic

Returns the P:Terraria.NPC.FullName of the first active NPC of the given type in the world. If not found, the type name is returned instead.

Parameters
npcID
Returns

Definition at line 1845 of file NPC.cs.

1846 {
1847 for (int i = 0; i < 200; i++)
1848 {
1849 if (Main.npc[i].active && Main.npc[i].type == npcID)
1850 {
1851 return Main.npc[i].FullName;
1852 }
1853 }
1854 return Lang.GetNPCNameValue(npcID);
1855 }

References Terraria.Lang.GetNPCNameValue(), and Terraria.Main.npc.

Referenced by Terraria.GameContent.ShopHelper.ApplyNpcRelationshipEffect(), Terraria.GameContent.ShopHelper.LikePrincess(), and Terraria.GameContent.ShopHelper.LoveNPCByTypeName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: