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

◆ NPCLoot()

void Terraria.NPC.NPCLoot ( )
inline

Definition at line 71114 of file NPC.cs.

71115 {
71116 if (Main.netMode == 1 || type >= NPCID.Count || (Main.getGoodWorld && !downedBoss3 && (type == 31 || type == 294 || type == 296 || type == 295 || type == 32 || type == 34 || type == 71)))
71117 {
71118 return;
71119 }
71120 Player closestPlayer = Main.player[Player.FindClosest(position, width, height)];
71121 if (0 == 0)
71122 {
71125 {
71127 {
71128 Main.BestiaryTracker.Kills.RegisterKill(this);
71129 }
71131 }
71132 }
71133 if ((type == 23 && Main.hardMode) || (SpawnedFromStatue && NPCID.Sets.NoEarlymodeLootWhenSpawnedFromStatue[type] && !Main.hardMode) || (SpawnedFromStatue && NPCID.Sets.StatueSpawnedDropRarity[type] != -1f && (Main.rand.NextFloat() >= NPCID.Sets.StatueSpawnedDropRarity[type] || !AnyInteractions())))
71134 {
71135 return;
71136 }
71141 if (!num && downedMechBoss1 && downedMechBoss2 && downedMechBoss3 && Main.hardMode)
71142 {
71143 if (Main.netMode == 0)
71144 {
71145 Main.NewText(Lang.misc[32].Value, 50, byte.MaxValue, 130);
71146 }
71147 else if (Main.netMode == 2)
71148 {
71149 ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[32].Key), new Color(50, 255, 130));
71150 }
71151 }
71154 }
static void BroadcastChatMessage(NetworkText text, Color color, int excludedPlayer=-1)
Definition ChatHelper.cs:46
Vector2 position
Definition Entity.cs:14
static float[] StatueSpawnedDropRarity
Definition NPCID.cs:4180
static bool[] NoEarlymodeLootWhenSpawnedFromStatue
Definition NPCID.cs:4182
static readonly short Count
Definition NPCID.cs:11744
static NetworkText FromKey(string key, params object[] substitutions)
static bool downedMechBoss2
Definition NPC.cs:425
void CountKillForAchievements()
Definition NPC.cs:72070
bool SpawnedFromStatue
Definition NPC.cs:85
void NPCLoot_DropMoney(Player closestPlayer)
Definition NPC.cs:71825
static bool downedMechBoss3
Definition NPC.cs:427
void CountKillForBannersAndDropThem()
Definition NPC.cs:72016
void NPCLoot_DropItems(Player closestPlayer)
Definition NPC.cs:71176
bool GetWereThereAnyInteractions()
Definition NPC.cs:72060
void NPCLoot_DropHeals(Player closestPlayer)
Definition NPC.cs:71364
int type
Definition NPC.cs:445
bool AnyInteractions()
Definition NPC.cs:71041
void DoDeathEvents(Player closestPlayer)
Definition NPC.cs:71463
void DoDeathEvents_BeforeLoot(Player closestPlayer)
Definition NPC.cs:71166
static bool downedBoss3
Definition NPC.cs:349
bool IsNPCValidForBestiaryKillCredit()
Definition NPC.cs:71156
static bool downedMechBoss1
Definition NPC.cs:423

References Terraria.NPC.AnyInteractions(), Terraria.Main.BestiaryTracker, Terraria.Chat.ChatHelper.BroadcastChatMessage(), Terraria.ID.NPCID.Count, Terraria.NPC.CountKillForAchievements(), Terraria.NPC.CountKillForBannersAndDropThem(), Terraria.NPC.DoDeathEvents(), Terraria.NPC.DoDeathEvents_BeforeLoot(), Terraria.NPC.downedBoss3, Terraria.NPC.downedMechBoss1, Terraria.NPC.downedMechBoss2, Terraria.NPC.downedMechBoss3, Terraria.Player.FindClosest(), Terraria.Localization.NetworkText.FromKey(), Terraria.Main.getGoodWorld, Terraria.NPC.GetWereThereAnyInteractions(), Terraria.Main.hardMode, Terraria.Entity.height, Terraria.NPC.IsNPCValidForBestiaryKillCredit(), Terraria.Lang.misc, Terraria.Main.netMode, Terraria.Main.NewText(), Terraria.ID.NPCID.Sets.NoEarlymodeLootWhenSpawnedFromStatue, Terraria.NPC.NPCLoot_DropHeals(), Terraria.NPC.NPCLoot_DropItems(), Terraria.NPC.NPCLoot_DropMoney(), Terraria.Main.player, Terraria.Entity.position, Terraria.Main.rand, Terraria.NPC.SpawnedFromStatue, Terraria.ID.NPCID.Sets.StatueSpawnedDropRarity, Terraria.NPC.type, and Terraria.Entity.width.

Referenced by Terraria.NPC.checkDead(), and Terraria.NPC.DropEoWLoot().