Luck

Luck is a hidden statistic that influences the random nature of various activities in Terraria. There are various ways to increase and decrease this statistic, such as buff potions and Torch placement. Players can estimate their luck value by speaking to the Wizard.

Luck influences many of Terraria's randomly-chosen items and events, such as the chances of item drops, rare enemy and critter spawns, certain town NPCs' first appearances, or the Traveling Merchant's inventory items.

Influences
Luck is impacted by Ladybugs, certain types of Torches, the Lucky buff, Lantern Nights, Garden Gnomes, and throwing coins into Shimmer.

With all positive effects, it is possible to reach a maximum luck value of 1.4, although with no benefit beyond a value of 1. The only factor with a negative effect on luck is from Ladybug luck, making it possible to reach a minimum luck value of −0.4.

Ladybugs
The player's interactions with, , and town NPCs have a certain influence on their luck. The following is a simplified summary; see the Technical details section for a more detailed and accurate explanation.


 * Touching a Ladybug grants +0.2 /  +0.4 Ladybug luck that decreases linearly to 0 over the course of  12 /  24 minutes.
 * Killing a Ladybug at a close distance or consuming one as bait during fishing causes −0.2 /  −0.4 Ladybug luck that increases linearly to 0 over the course of  3 /  6 minutes.
 * Killing any town NPC other than the Guide and the Clothier causes −0.067 Ladybug luck that increases linearly to 0 over the course of 1 minute.
 * Killing the Guide causes +0.067 Ladybug luck (unless the player already has negative Ladybug luck) that decreases linearly to 0 over the course of 4 minutes.

It can be seen that, overall, positive Ladybug luck lasts four times as long as negative Ladybug luck. Ladybug luck is reset to 0 as soon as the player leaves the world.

Technical details
By default, the player has "neutral Ladybug luck", which means that Ladybug luck contributes a value of 0 to the player's overall luck. The player can have "good Ladybug luck", in which case the Ladybug luck value is positive, or "bad Ladybug luck", in which case the Ladybug luck value is negative. The Ladybug luck value is added to the player's overall luck. Both "good" and "bad Ladybug luck" are caused by certain actions by the player, are temporary, and have a set duration, and once it elapses, the player has "neutral Ladybug luck" again.

The Ladybug luck value depends on the remaining duration of "good" or "bad Ladybug luck", calculated with the following formula:

$$\text{ladybug luck} = \frac{ \text{duration}_\text{seconds} }{x} * 0.2$$,

where $$x$$ is 720 if the player has "good Ladybug luck" and −180 if the player has "bad Ladybug luck".

For example, if the player has 4 minutes of "bad Ladybug luck" remaining, their Ladybug luck value is −0.267. If they have 42 seconds of "good Ladybug luck" remaining, their Ladybug luck value is +0.01167.

There are five events that cause the player to receive a specific duration of "good" or "bad Ladybug luck":


 * If the player touches a naturally spawned Ladybug (i.e. one that has not been released by a player), then they will receive "good Ladybug luck" for 12 /  24 minutes.
 * "Touching" refers to an overlap of hitboxes here. If the player's hitbox somehow happens to be so large that its center is at least 30 pixels (1.875 tiles) away from the center of the Ladybug's hitbox, then the duration of the "good Ladybug luck" is reduced based on the distance, according to the following formula: $\text{duration}_\text{seconds} = \left\lfloor 43200 * \left( 1- \frac{ \text{distance}_\text{pixels} }{800} \right) ^{6.0} * \text{golden} \right\rfloor \div 60$ Where "golden" is 1 if a normal ladybug and 2 if golden. In either case, however, this effect is minuscule and can most often be disregarded.


 * If the player kills a Ladybug at a close distance, they will receive "bad Ladybug luck". The duration depends on the distance:
 * If the player is less than 6.25 tiles away, then the "bad Ladybug luck" will last 3 /  6 minutes. Consuming a Ladybug as bait during fishing counts as a kill with a distance of 0.
 * If the player is between 6.25 and 25 tiles away, the duration depends on the distance, according to the following formula: $\text{duration}_\text{seconds} = \left\lfloor 10800 * ( 1 - \frac{\text{distance}_\text{pixels}}{400}) \right\rfloor \div 60$ (doubled for Gold Ladybugs). For example, at a distance of 10 tiles (160 pixels), the "bad Ladybug luck" will last   /  . At a distance of 24.5 tiles (392 pixels), the "bad Ladybug luck" will last  3.6 /  7.2 seconds.
 * If the player is 25 tiles or more away from the Ladybug when it is killed, they will not receive "bad Ladybug luck".


 * If the player kills the Guide and they do not have "bad Ladybug luck", they will receive "good Ladybug luck" for 4 minutes.


 * If the player kills any town NPC (including the town pets and the Traveling Merchant) other than the Guide and the Clothier, they will receive "bad Ladybug luck" for 1 minute.

If the player receives "good Ladybug luck" while they have "bad Ladybug luck", the duration of the "bad Ladybug luck" is canceled immediately and they are granted the full duration of the "good Ladybug luck" (and vice versa), with the exception of killing the Guide (which only grants "good Ladybug luck" if the player does not already have "bad Ladybug luck"). If the player receives "good Ladybug luck" while they already have "good Ladybug luck", then the durations will not be added. Instead, whichever of the two durations is greater will continue to be counted down. The same applies to "bad Ladybug luck".

This reveals that the maximum duration of "good Ladybug luck" is 24 minutes (granted by touching a Gold Ladybug), which results in an initial Ladybug luck value of $\frac{1440}{720}*0.2 = +0.4$, and that the maximum duration of "bad Ladybug luck" is 6 minutes (caused by consuming a Gold Ladybug as bait or killing one at very close range), which results in an initial Ladybug luck value of $\frac{360}{-180}*0.2 = -0.4$. Of course, both of these values are merely momentary. After half a minute (assuming no new Ladybug luck is received in the meantime), both values will have already changed to +0.39167 and −0.367, respectively.

Torches
By placing or holding Torches in the correct locations, players can increase their luck:


 * Placed Torches on the Surface and in Space are ignored. This means that in these layers, only held Torches will affect luck.
 * Torch luck does not apply in the Dungeon or Jungle Temple.
 * In the Underground and below, each type of Torch present in a 40×40-tile rectangle centered on the player (and also any Torch they are holding) will increase or reduce Torch luck, with the total value limited to a maximum of 0.2 and a minimum of 0.
 * With some exceptions, biome Torches give good luck in their own biome, while giving a luck penalty in any other location.
 * Ordinary Torches give a penalty anywhere that a biome Torch would be available, and especially the Snow biome. Bone Torches give a bonus in biomes without their own biome Torch (and also the Ocean).
 * Colored and Ultrabright Torches, along with other light sources such as Candles, have no effect.
 * The good luck, and luck penalty, are independently limited to a maximum of 0.2 for good luck and 0.3 for the luck penalties. Thus, multiple Torches of a given type will have no increased benefit, and one or more incorrect Torches will completely negate the benefits of Torch luck.
 * No matter what penalties accumulate, Torch luck overall cannot go below 0 – it can either provide a bonus to luck, or nothing at all.

Luck Potions
The Lucky buff increases luck based on how much time there is left:

The values do not stack, so using a Greater Luck Potion (which lasts for ) will yield +0.3 luck for 10 minutes, then +0.2 luck for 2 minutes, and finally +0.1 luck for 3 minutes. The only difference between the Luck Potions is the duration of the effect.

Lantern Nights
The Lantern Night event increases luck by a value of +0.3. This is active everywhere in the world, even underground. However, a Lantern Night will never start if there is a Blood Moon, Pumpkin Moon, Frost Moon, or any other invasion event active, if any boss is alive, or if the Moon Lord is being summoned.

Garden Gnomes
If there is a Garden Gnome within range of the player, their luck will be increased by a value of +0.2. This effect does not stack with multiple gnomes.

Throwing Coins Into Shimmer
Throwing Coins into Shimmer consumes the coin, and increases the player's Coin Luck. The amount of time that the player's luck is increased is based on the value of coins thrown into the Shimmer.

Galaxy Pearl
Using the Galaxy Pearl will permanently increases a character's luck by 0.03. It cannot be used more than once per character.

Accessories
The Lucky Horseshoe and Lucky Coin will increase luck by 0.05 each. Their upgrades have the same effect but do not stack with their components.

Someone is gonna have to make these last two more professional later.

Done -Kaizrblade

Impact
Luck has a significant impact on multiple random chances throughout the game. Whenever a random chance is rolled in one of the ways listed below, an additional modifier is applied to the chance that the roll has a positive result:
 * If the player's luck is greater than 0, then there is a (100 * luck)% chance that the chance is increased.
 * The exact increase is itself randomized: if the base chance is 1 in X, the chance will become 1 in Y, where Y is a uniformly-distributed random number between X/2 and X-1 (inclusive). Therefore, an event occurring with a base chance of 1 in X will, on average, become a 1 in (3X-2)/4, with probability (100 * luck)% chance.
 * If the player's luck is less than 0, then there is a (-100 * luck)% chance that the chance is decreased.
 * Similarly to the above, the decrease is randomized: if the base chance is 1 in X, the chance will become 1 in Y, where Y is a random number between X and X*2-1 (inclusive).
 * If the player's luck is 0, the chance will be the base value.

For example, if the base probability of an event is 10%, then:
 * If the player's luck is 1.0, there is a 100% chance that the probability will become something between 1 in 5 and 1 in 9, leading to an average final probability of approximately 14.9%.
 * If the player's luck is 0.5, there is a 50% chance that the probability is increased, leading to an average final probability of approximately 12.5%.
 * If the player's luck is 0.0, the final probability is equal to the base probability, 10%.
 * If the player's luck is -0.2, there is a 20% chance that the probability will become something between 1 in 10 and 1 in 19, leading to an average final probability of approximately 9.44%.
 * If the player's luck is -0.4, there is a 40% chance that the probability will be decreased, leading to an average final probability of approximately 8.88%.

As an example, for a drop that has a chance of 2% on killing an enemy, if that enemy is killed 1000 times, one would expect 20 of that drop:


 * After killing a Ladybug, one would instead get 18 (rounding down) of that drop. If it took an hour to farm for this drop, it now would take an additional 7 minutes. Note that the negative Ladybug luck would wear out by then.
 * In an Underground Jungle biome with a single Jungle Torch, a Garden Gnome, with 5 minutes of the Lucky buff remaining, on a Lantern Night, one would get 28 of that drop. If it took an hour to farm for this drop, it now would take approximately 17 fewer minutes.

Item drops
With a few exceptions, almost all drop rates of items are affected by luck. The luck of the player closest to the defeated enemy is used for the calculation.


 * This includes the chances of enemies dropping Hearts and Mana Stars, as well as the chances of the Zombie Elf, Scarecrow, Hellhound, and Poltergeist dropping more than one Heart.
 * Any time a boss (or certain other enemy, notably Mimics and Biome Mimics) is guaranteed to drop one item from a list, luck does not apply to the choice. The following other boss drops are also unaffected by luck:


 * Another exception is the Feather dropping from Harpies, which always has a chance unaffected by luck.
 * Players with high luck have better coin drop rates in the same way as damage, for around a 15% increase/decrease at maximum/minimum luck.
 * Only enemy drops are affected by luck. The drop rates of items from grab bags like crates or Oysters are unaffected.

NPC spawning
There are several NPC spawn rates that are affected by the player's luck:


 * Golden critters replacing a regular critter spawn (including shaken trees).
 * A Dungeon Spirit spawning from a defeated Dungeon enemy.
 * For this calculation, the luck of the player closest to the defeated enemy is used.
 * A Hardmode Dungeon enemy spawning on the wrong wall type (e.g. a Skeleton Commando spawning on Slab Walls).
 * The spawn rates of the following entities:

Other mechanics

 * The chance of Coin Portals appearing from Pots is affected by the luck of the player closest to the broken Pot.
 * The player with the highest luck will influence the chances of items being available for sale in the Traveling Merchant's inventory.
 * While fishing, positive luck gives a (100 * luck)% chance of silently multiplying your fishing level by a random number between 110% and 140%.
 * Inversely, negative luck gives a (-100 * luck)% chance of silently multiplying fishing power by a random number between 60% and 90%.
 * Actual fishing rewards are not influenced by luck beyond fishing power.
 * Damage calculations in many situations are influenced by luck; positive luck will be favorable to the player. Projectiles are influenced by luck, as is enemy melee damage (e.g. touching a Zombie). Player weapons also take luck into account.
 * The following steps are taken to incorporate luck into a player's damage:
 * The initial damage value is generated.
 * The game checks if the player has > 0 luck, and if so, generates a random number from 0.0 to 1.0. If the random number is less than the player's luck, a second damage value is generated, with the formula $$\text{dmg} * (1 + \text{rand} * 0.01)$$, where $$\text{rand}$$ is a number between -15 and 15, inclusive. Once the second value is calculated, the higher of the two numbers is dealt. The final multiplier is between 100% and 115%.
 * If the player has < 0 luck, a random number is generated from 0.0 to 1.0. If the random number is less than the absolute value of the player's luck, a second damage value is generated, with the same formula as above. Once the second value is calculated, the lower of the two numbers is dealt. The final multiplier is between 85% and 100%.
 * This is up to a 5% increase/decrease in average damage before defense.
 * Luck affects PvP the same way it affects regular enemies.
 * Thorns Potion, Turtle armor set bonus, Brand of the Inferno and Sergeant United Shield parry damage are all affected inversely by luck. Positive luck values have a chance to decrease potential incoming damage, which would decrease reflected damage caused by thorns effect or parrying.

Not Affected by Luck
A list of mechanics which are not affected by luck (including points made above):


 * Fishing catches (beyond fishing power effects) or Angler rewards.
 * Loot from any grab bags item such as crates or Oysters.
 * For any boss or enemy drop which is guaranteed to choose one item from a list, the choice is unaffected.
 * Some boss drops listed above.
 * Feathers have a fixed drop chance from Harpies.
 * Any "dodging" mechanic from armor, accessories, etc.
 * Ammo conservation rates.
 * Event occurrences (Luck is itself affected by Lantern Nights as above).
 * Health and mana recovery.
 * Buff or debuff effects, other than thorns.

Wizard Luck status
The Wizard will occasionally give the player a general idea of what their luck value is, in place of his regular dialogue.

Trivia

 * When introduced, mismatched Torches could result in a negative Torch luck value, reducing the final luck score. This was removed shortly after, in, after a Reddit post criticizing the mechanic garnered attention, causing a large community backlash. This change caused the Wizard's messages below −0.42 luck to become impossible to see in-game.