Following all the help I received in this topic I decided to share all the code involved in a mana system I've been working on in the past few days. The goal is to replace Vancian Magic, of course.
Some forewarning:
1) You need to mofidy the ingameui.ini (I modified all 3 of them, x1 and x2 too) to add the GUI to the mandatory ones.
2) Some resources shown here like the mana bar .tga icon is custom made. (I just took the default health bar, rotated it 90 degrees and colored it blue). You need to have that file or replace it with something else.
3) The system itself is designed to fit a very customized setting. Lots of changes have been made in my override folder (mostly .2das and scripts) and as it's presented here it's designed to fit my setting, to fit other settings you may have to change the rules a bit. (Some could consider this overpowered or underpowered depending on the module or personal preferences)
4) All spellcasters in your classes.2da must have -Has infinite spells- set to 1. (like Warlocks)
Known Issues:
1) Haven't thought yet of a way to show/hide the GUI. (But I'm sure this can be done easily by someone more expert than me, and eventually I'll modify it as well)
2) Resting when you are not controlling your main PC does not restore mana. (Probably there's a workaround for this too, but that's not really high priority imho).
3) Whenever you are not controlling the main PC the "insufficient mana" message is displayed twice. (so minor it could be ignored) ---SOLVED BY TCHOS--- (See post #10)
4) Extra-slot features for spontaneous spellcasters become totally useless.
Overall explanation of the system:
All creatures have mana. The maximum amount of mana is defined by your class levels and your Wisdom (affects Mana just like Constitution affects Health).
I decided to make the amount of maximum granted by a class level equal to 18-HD-SP. For consistency and easiness of coding. (HD is Hit Dice Size, and SP is Skill Points per Level). For example wizards gain 12 MP per level, Bards 6 MP and Clerics 8 MP. Even non-casters give mana this way, I thought that it could come in handy later for new prestige classes or new feats that are not spells and consume mana in other manners.
Every arcane or divine spell you cast costs MP.
The formula for deciding the MP cost is the following: (Innate Spell Level+ Meta Modifier + 1)^2
The following list gives the values per level
Level 0: 1 MP
Level 1: 4 MP
Level 2: 9 MP
Level 3: 16 MP
Level 4: 25 MP
Level 5: 36 MP
Level 6: 49 MP
Level 7: 64 MP
Level 8: 81 MP
Level 9: 100 MP
NOTE: In my settings I have changed the class spell levels to make them fit with Innate or viceversa. This rules is a bit different if you don't modify your Class Spell levels in your spells.2da.
This can be modified / expanded. (for example you could add potions that restore mana or modify the rules that decide max MP and MP cost if you don't like them).





Retour en haut






