The formula for MP is:
MP = Mana * (Magic + CharacterLevel * (6 * Magic + 3 * Will + Learning) / 75) / 100
Keep in mind that this game uses integer math and truncates all decimals (rounds down all fractions) to a whole number at the time of dividing.
This means that mana directly multiplies your total MP, and it is difficult to compensate for having a low score in it - race choices matter to a significant degree. (A lich gets 40% more MP than average characters with their 140 mana.) Character level similarly multiplies MP, so simply gaining levels can also be one of the more direct ways to increase MP, but that Magic is also the most crucial attribute in multiplying your MP score. Will, meanwhile, also adds to your HP, however.
MP is a very important stat for wizards. MP does not stop at merely 0, you can have negative MP, whether this is by being drained of MP (such as by failing to read a spellbook), by overcasting (casting with insufficient MP), or by being affected by MP-draining special abilities of enemies. When your MP goes negative, a magic reaction occurs in which you take as much as four times as much HP damage as your MP are negative (which can easily be instantly fatal to some characters), although this can be reduced through the Magic Capacity skill. Elea have the additional ability of halving the damage of mana reactions on top of their Magic Capacity skill's reductions.
Note that for characters that do not cast spells, high MP can actually be a liability under certain circumstances: Some (fortunately rare) high-level creatures can force a mana reaction by instantly draining double your total MP. With no Magic Capacity skill and full MP, that can inflict 4 times your maximum MP in a single shot, and instantly kill a character without significantly more HP than MP.
The following formula for maximum MP is correct as of 1.75:
- Contribution from level is capped at 10,000.
- Contribution from Mana is capped at 1,000.
- Contribution from the following is capped at 2,000,000:
Rounding down to the nearest integer occurs after every division.
Formulae for previous versions
In version E+ 1.56:
- Maximum MP = ((Magic * 2 + Will + Learning) / 4 * Level / 5 + Magic) * Mana / 100
Level is capped at 10,000
Mana is capped at 1,000
((Magic * 2 + Will + Learning) / 4 * Level / 5 + Magic) is capped at 2,000,000
The formula had been altered to make Will and Learning attributes and Level have a greater effect on MP.
In 1.47 to 1.55:
- ((Magic * 2 + Will + Learning) * Level / 20 + Magic) * Mana / 100
This formula made maximum MP overflow at a value somewhere above 21 million, after which it became 1.