Experience and levels
The party · Attributes and classes · Scripted experience awards
In brief
Experience comes from killing monsters and from script awards, shared between the eligible characters. Each character divides its share between its classes. A class gains a level when its experience is strictly above the next threshold, at most one level per award, and 13 is the highest level experience can reach. A level adds hit points, rolled with the class's hit die up to a given level and fixed above it, plus the constitution modifier.
Experience and levels
A script shares an award between the eligible party members; see scripted experience awards; a negative award can grant levels (anomaly). Killing a monster awards its type's experience the same way; see when a monster dies. Each character then divides its share between its classes:1
share = amount / number_of_classes # integer division
for each class c of the character:
experience[c] += share
next = threshold(c, level[c] + 1)
if next != -1 and experience[c] > next: # strictly more
gain_a_level(c)
Each class is compared once per award, so an award raises a class by at most one level even when it covers several thresholds; the next award raises it again. The thresholds, in experience points, are:
| Level | Fighter | Mage | Cleric | Thief | Paladin, ranger |
|---|---|---|---|---|---|
| 1 | 0 | 0 | 0 | 0 | 0 |
| 2 | 2,000 | 2,500 | 1,500 | 1,250 | 2,250 |
| 3 | 4,000 | 5,000 | 3,000 | 2,500 | 4,500 |
| 4 | 8,000 | 10,000 | 6,000 | 5,000 | 9,000 |
| 5 | 16,000 | 20,000 | 13,000 | 10,000 | 18,000 |
| 6 | 32,000 | 40,000 | 27,500 | 20,000 | 36,000 |
| 7 | 64,000 | 60,000 | 55,000 | 40,000 | 75,000 |
| 8 | 125,000 | 90,000 | 110,000 | 70,000 | 150,000 |
| 9 | 250,000 | 135,000 | 225,000 | 110,000 | 300,000 |
| 10 | 500,000 | 250,000 | 450,000 | 160,000 | 600,000 |
| 11 | 750,000 | 375,000 | 675,000 | 220,000 | 900,000 |
| 12 | 1,000,000 | 750,000 | 900,000 | 440,000 | 1,200,000 |
| 13 | 1,250,000 | 1,125,000 | 1,125,000 | 660,000 | 1,500,000 |
Level 14 has no threshold, so 13 is the highest level experience can reach. A special event grants one level through this same path, which does not work for multi-class characters.
Gaining a level
When a class gains a level, the game:2
- adds one to that class's level;
- adds the hit points below to both
hit_pointsandhit_points_max; - prints "name has gained a level." and plays sound 23.
New spell slots take effect the next time the character memorizes or prays. The hit points gained are computed for the class that gained the level:
if level[c] <= rolled_up_to_level(c):
gain = roll(1, hit_die(c))
else:
gain = fixed_gain(c)
gain += constitution_modifier
hit_points_gained = max(1, gain / number_of_classes) # integer division
The constitution modifier is added even above the last rolled level. It is, by constitution score:
| Constitution | 1 | 2–3 | 4–6 | 7–14 | 15 | 16 | 17 | 18 | 19 | 20–22 | 23–24 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Modifier | −3 | −2 | −1 | 0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 |
Except for fighters, paladins and rangers, a modifier above +2 counts as +2.
Sources
Locations refer to the game executable reference;
comparative sources are listed in the technical references.
The figures are drawn by make_party_figures.py.