THAC0

THAC0 is an acronym for To Hit Armor Class 0 (Zero). It is a number that represents the chances that a physical attack hit its target. Lower numbers are better.
== How it works ==
Every time a creature makes a physical attack, the game simulates an attack roll, which is the roll of a 20-sided die. A roll of 20 is always a successful hit, a roll of 1 always a miss. Otherwise, the minimum roll required to hit successfully is obtained by subtracting the target's Armor Class from the attacker's THAC0.
 Attack roll ≥ THAC0 - AC
For example, a character with a THAC0 of 17 trying to hit a target with an AC of 1 needs a roll of at least 17-1=16 to succeed. This is a chance of 5/20, or 25%. A character with a much lower THAC0 of 5 trying to hit the same target needs a roll of at least 5-1=4. This is a chance of 17/20, or 85%.
===Combat log===
The game has an option that displays information on to-hit attempts in the combat logs. It can be enabled through the Options menu, Gameplay section, Feedback subsection. Once done, the logs will show information on attack rolls:
 Attacker name: A + B = C : Hit (or Miss)
With A being the number rolled by the 20-sided die, and B the static bonuses to the attack roll. The higher the resulting C is, the better for the attacker.
Check the talk page for an in-depth view of what B contains, and the top of this post for what is done with C.
With the hidden gameplay options mod, the detailed modifiers affecting B can be shown in the combat log by installing "Show extra combat info" and then activating it in the game options (Gameplay > Feedback > Feedback Messages).https://github.com/Argent77/A7-HiddenGameplayOptions
== Ways to use it from a player's perpective ==
As a player trying to assert which kind of AC I can reasonably hit, I could reword the equation to:
 THAC0 ≤ AC + Attack roll
If I am only ready to accept missing about once out of seven attacks against AC -10 (~85% chance to hit), that means I need to aim for the following THAC0:
 AC + (1 - Desired_Chance_To_Hit) x 20 + 1 = THAC0 
 -10 + (1 - 0.85 ) x 20 + 1 = -6
85% chance to hit AC -10 will be achieved if I can reach -6 THAC0.
Similarly, as a player trying to assert which kind of AC I need in order to reasonably resist against a given THAC0 value, I could reword the equation so that it describes to-miss rolls rather than to-hit. To miss, AC needs to be:
 AC < THAC0 - Attack roll
If I am only ready to accept getting hit once out of five against opponents with THAC0 7 (80% chance to miss), that means I need to aim for the following AC:
 THAC0 - Desired_Chance_To_Not_Be_Hit x 20 - 1 = AC
 7 - 0.8 x 20 - 1 = -10
80% chance to make a THAC0 of 7 miss is achieved if I can reach -10 AC.
==THAC0 Progression==
THAC0 improves by leveling up the character. 
There're four different THAC0 progression rates by class level:
* Warrior group (Fighter, Ranger, Paladin) and Monk have the best THAC0 progression, with a THAC0 that decreases at a rate of 1:1 (-1 point per level), to a max of base 0 at level 21.
* Priest group (Cleric, Druid, Shaman) except Monk have the second best rate of 2:3, to a max of base 6 at level 22.
* Rogue group (Thief, Bard) have a rate of 1:2, to a max of base 10 at level 21. In addition to the mathematical oddity of having a better THAC0 than a priest at level 3, rogues remain roughly on-par with priests (albeit slightly in the priest's favor) until level 9, and are thereafter surpassed by priest classes at an increasing pace.
* Wizard group (Mage, Sorcerer) have the worst THAC0 progression, at a rate of 1:3, to a max of 13 at level 22.
Regardless of a creature's THAC0, in Second Edition Dungeons & Dragons, a roll of 20 is always a critical (guaranteed) hit while a 1 is always a critical miss, both are 5% chances.  See the Critical hit article for more details.
The previous progression rate gives the following table for THAC0 progression (note, that there are no further changes from level 22 on):
Level	Warriors,Monk	Priests	Wizards	Rogues
1 	20 	20 	20 	20
2 	19 	20 	20 	20
3 	18 	20 	20 	19
4 	17 	18 	19 	19
5 	16 	18 	19 	18
6 	15 	18 	19 	18
7 	14 	16 	18 	17
8 	13 	16 	18 	17
9 	12 	16 	18 	16
10 	11 	14 	17 	16
11 	10 	14 	17 	15
12 	9 	14 	17 	15
13 	8 	12 	16 	14
14 	7 	12 	16 	14
15 	6 	12 	16 	13
16 	5 	10 	15 	13
17 	4 	10 	15 	12
18 	3 	10 	15 	12
19 	2 	8 	14 	11
20 	1 	8 	14 	11
21 	0 	8 	14 	10
≥22 	0 	6 	13 	10
Several classes and kits gain additional THAC0 bonuses beyond their base group:
* Swashbuckler (Thief kit): 1 every 5 levels
* Assassin (Thief kit): starts with a bonus of 1
* Kensai (Fighter kit): 1 every 3 levels
* Archer (Ranger kit), only for missile weapons: 1 every 3 levels till level 18, then every 5th level
* Skald (Bard kit): starts with a bonus of 1
The following classes and kits gain additional THAC0 bonuses against specific enemies:
* Undead Hunter (Paladin kit): bonus of 3 against undead
* Cavalier (Paladin kit): bonus of 3 against demons and dragons
* Ranger: bonus of 4 against their selected racial enemy
=== Racial bonus ===
Elves get a THAC0 bonus of 1 when using longbows (including composite longbows), shortbows, short swords or long swords. Halflings get a bonus to slings.
== Improving and worsening THAC0==
Beyond simply leveling, THAC0 can be improved in a number of ways:
*numerous magical weapons offer a "to hit" bonus
*increasing Weapon Proficiency
*depending on the weapon, improving either strength (melee) or dexterity (ranged)
*dual wielding: by default a malus of 4 for main hand, 8 for off-hand; can be decreased with two-weapon fighting (see Weapon Proficiency)
* improving luck
*improving chances of landing a critical hit
*the following potions improve THAC0: 
**Potion of Heroism will decrease base THAC0 to 90% of its normal value for 2 hours
**Potion of Power will decrease base THAC0 to 80% of its normal value for 4 turns
*various items offer THAC0 bonuses (see table below)
*various spells, innate abilities and HLA's improve THAC0, either by boosting strength or effecting THAC0 directly 
**for spells related to strength, see that article.
**for spells and abilities that directly boost THAC0, see the table later in this article
*using a ranged weapon against a melee attacker gives -8 penalty to THAC0, whereas the melee attacker gains a +4 THAC0 and damage bonus when engaging an enemy that uses a ranged weapon
*attacking in melee from invisibility / stealth adds a THAC0 bonus of 4 to the first attack
*finally, lowering enemy Armor Class also increases your chance to hit; vice versa, increasing your own armor class lowers the chance of enemies hitting you
*attacks against helpless targets, as well as attacks against targets affected by Time Stop / Time Trap and attacks during Critical Strike automatically hit regardless of THAC0
*attacks with spells (except for spells that summon weapons, like Melf's Minute Meteors), and area of effect attacks, do not rely on THAC0
===THAC0-boosting equipment===
Item 	THAC0 Bonus	Usability
Bracers of Archery 	-2 	Missile weapons only, not usable by Druid, Mage, Cleric, Kensai and Sorcerer
Circlet of Lost Souls 	-2 	Usable by Shaman
Gauntlets of Extraordinary Specialization	-1 	Usable by Warriors, except Kensai and Wizard Slayer
Glimmering Bands 	-2 	Only usable by Rasaad yn Bashir
Helm of Balduran 	-1 	Not usable by Mage, Bard, Thief, Sorcerer, Kensai or Monk
Legacy of the Masters 	-1 	Not usable by Kensai or Wizard Slayer
Pale Green Ioun Stone 	-1 	Usable by all
The Visage 	-1 	Not usable by good alignments, Bard, Mage, Mage / Thief, Thief, or Monk
Wondrous Gloves 	-1 	Usable by Bards
Xarrnous's Second Sword Arm 	-1 	Not usable by Kensai or Wizard Slayer
Not included in the table above is the upgraded version of the scimitar Spectral Brand, which has a daily charge ability that will improve THAC0 by 10 for 3 rounds. Also not included, the composite longbow Heartseeker, which has a daily charge ability that will improve ranged THAC0 by 7 for 1.5 rounds.
===Situational THAC0-boosting equipment===
Item 	THAC0 Bonus 	Usability
Bone Club 	-1 vs Undead 	Unusable by Mages
The Burning Earth 	-1 vs Lycanthropes and Trolls
-2 vs Winter Wolves
-3 vs Undead	Unusable by Beastmasters, Clerics, Druids, Mages and Shamans
Daystar 	-2 vs Evil 	Unusable by Beastmasters, Clerics, Druids, Mages and Shamans
Eadro's Blade 	-1 vs Elementals and Mephits 	Unusable by Beastmasters, Clerics, Mages and Shamans
The Equalizer 	-1, -2 or -3, according to the enemy's alignment	Unusable by Beastmasters, Clerics, Druids, Mages and Shamans
Gauntlets of Crushing 	-4 to Unarmed and Monk Fists 	Unusable by Kensai and Wizard Slayers
Grubdoubler's Axe 	-3 vs Humans 	Only usable by M'Khiin
Harrower 	-2 vs Undead 	Unusable by Beastmasters, Clerics, Druids, Mages and Shamans
Jerrod's Mace 	-3 vs Demons and Devils 	Unusable by Beastmasters, Druids, Mages, Monks, Shamans and Thieves
The Kneecapper 	-3 vs Giant Humanoids 	Unusable by Beastmasters, Druids, Mages, Monks, Shamans and Thieves
Kondar 	-2 vs Shapeshifters 	Only usable by Bards, Fighters, Rangers (except Beastmasters) and Paladins
Modron Heart 	-2 vs Chaotic 	Unusable by Chaotic and Wizard Slayers
Mosela's Cudgel 	-3 vs Constructs 	Unusable by Mages
Pritchard's Family Stiletto	-2 vs Giant Humanoids 	Unusable by Beastmasters and Clerics
The Root of the Problem 	-2 vs Giant Humanoids, Monsters and Undead 	Unusable by Mages
Sword of Balduran (BG1) 	-4 vs Lycanthropes 	Only usable by Bards, Fighters, Rangers (except Beastmasters) and Paladins
Trollblood Ioun Stone 	-3 vs Trolls 	Usable by anyone
Werebane 	-3 vs Lycanthropes 	Unusable by Beastmasters and Clerics
Wolfsbane Charm 	-2 vs Lycanthropes 	Unusable by Wizard Slayers
Items above, including weapons, give THAC0 bonuses to both hands when dual wielding.
With the exception of the Gauntlets of Crushing, these situational THAC0 bonuses are all applied through a somewhat unusual status effect called THAC0 vs. type bonus (ID 178), which is a THAC0-equivalent to Damage vs type bonus. An attack roll cannot be modified by more than one THAC0 vs. type bonus. So for example if an attacker is currently benefiting from a -2 THAC0 bonus vs. Evil, a -3 bonus vs. Chaotic and another -5 bonus vs. Evil, and they're all applied through effect 178, then only one of these three bonuses will boost THAC0 against a Chaotic Evil defender. It is likely going to be the oldest effect to be evaluated by the game among equipped items.
===THAC0-boosting spells===
Spell/Ability 	Availability 	Effect on THAC0
Aid 	Priest 	Bonus of 1
Bless 	Priest 	Bonus of 1
Boon of Lathander 	Priest of Lathander	Bonus of 1
Champion's Strength 	Priest 	Bonus of 1 every 3 levels of the caster
Chant 	Priest 	Bonus of 1 (it's actually a luck bonus, not a proper THAC0 bonus)
Chaos of Battle 	Priest of Tempus 	25% chance of bonus 1 to 5 (based on level)
Divine Favor 	Priest of Tyr 	Bonus of 1 per 3 levels, up to 6 at lvl 18
Elemental Transformation (Earth and Fire)	Druid 	Base THAC0 set to 2
Enhanced Bard Song 	Bard 	Bonus of 4
Enrage 	Berserker 	Bonus of 2
Holy Power 	Priest 	Base THAC0 becomes that of a Fighter of the same level as the caster
Invoke Courage 	Mazzy 	Bonus of 1 with melee weapons
Slayer Form 	protagonist only 	Base THAC0 set to 0
Strength 	Mazzy 	Bonus of 4 to Mazzy
Offensive Spin 	Blade 	Bonus of 2
Skald Song 	Skald 	Bonus of 2 or 4 (based on level)
Tenser's Transformation 	Wizard (Alteration)	Base THAC0 becomes that of a fighter of the same level, with an additional bonus of 2
===THAC0-degrading spells===
Spells that inflict a THAC0 penalty
Spell/Ability 	Availability 	Effect on THAC0
Aura of Despair 	Blackguard 	Penalty of 1, 2 or 4 (based on level)
Called Shot 	Archer 	Penalty of 1 (per hit)
Chant 	Priest 	Penalty of 1 (it's actually a luck penalty, not a proper THAC0 one)
Chaos of Battle 	Priest of Tempus	Penalty of 1 to 5 (based on level, 25% chance)
Chill Touch 	Wizard 	Penalty of 2
Contagion 	Wizard 	Lower enemy strength and dexterity
Doom 	Priest 	Penalty of 2
Glass Dust 	neutral evil Wizard
(Find Familiar -> Dust Mephit)	Penalty of 2
Protection From Evil	Priest, Wizard 	Penalty of 2 for evil attackers
Ray of Enfeeblement 	Wizard 	Lower enemy strength
Slow (spell) 	Wizard 	Penalty of 4
Spirit Fire 	Shaman 	Penalty of 2 (33% chance)
Summon Insects 	Druid/Ranger 	Penalty of 2
Unholy Blight 	Priest 	Penalty of 2
Degrade Thac0 due to blindness effect (-4), not cumulative:
Spell/Ability 	Availability
Blindness (spell)	Wizard
Chromatic Orb 	Wizard
Glitterdust 	Wizard
Holy Smite 	Priest
Nature's Beauty 	Druid
Power Word, Blind	Wizard
Prismatic Spray 	Wizard
Sol's Searing Orb	Priest
Sunray 	Priest
Sun Soulbeam 	Sun Soul Monk
==BGWiki writing formats==
On Baldur's Gate Wiki, THAC0 value in Infobox creature, if not specified, is always the THAC0 after applying the class bonuses, but before ability scores and other factors, as shown in Near Infinity.
If a creature with a THAC0 of 6 wields a weapon with THAC0: +2 in its in-game description, the adjusted value will be 6-2=4, for this reason, weapons' THAC0: +n and all kinds of THAC0 or to-hit bonuses from any other sources will be written as -n bonus, where n is the positive integer, and vice versa.
==Trivia==
*Does not apply to the Baldur's Gate series: Starting from the 3rd edition of Dungeons & Dragons, the to-hit system has been reworked to always trend upward by using attack roll + attack bonus - enemy AC ≥ 0 to land hits, where better scores don't go into the negative numbers but rather continue growing in the positive integers.
== See also==
*Armor Class
*Saving throws
Ru:THAC0
Uk:УРЗ0
Category:Game mechanics