PDA

View Full Version : 3rd Ed Mathematical formula for bonus spells per day



redking
2023-11-11, 09:48 AM
Trying to figure out the mathematical formula for bonus spells per day without referring to the table is driving me nuts. Someone put me out of my misery by telling me how to calculate it.

Darg
2023-11-11, 11:04 AM
Trying to figure out the mathematical formula for bonus spells per day without referring to the table is driving me nuts. Someone put me out of my misery by telling me how to calculate it.

+1 slot at ability bonus = spell level.

+1 slot at every +4 bonus after the first per spell level.

So you get +1 3rd slot at a score of 16 (+3) and +2 at 24 (+7).

To calculate it subtract the spell level from your bonus, divide by 4, and add one. If it goes negative from the subtraction you get 0 bonus slots.

Biffoniacus_Furiou
2023-11-11, 12:04 PM
L = spell level
N = number of desired bonus spells
A = minimum ability score for that many bonus spells of that spell level

2L + 2 + 8N = A

KillianHawkeye
2023-11-11, 06:09 PM
If it helps, think of it like Base Attack Bonus, except it increases by 4s instead of by 5s.

You get one bonus for every spell level up to your ability bonus. Then for each +4 your ability bonus exceeds the spell level you get an extra bonus spell slot at that level. So you get your second bonus 1st-level spell slot at +5 ability bonus, and your third bonus 1st-level spell slot at +9 ability bonus, et cetera. And the same for higher level spells except the numbers go up accordingly (+6 for the second 2nd-level spell slot, +7 for the second 3rd-level spell slot, etc.).

Beni-Kujaku
2023-11-11, 06:21 PM
L = spell level
N = number of desired bonus spells
A = minimum ability score for that many bonus spells of that spell level

2L + 2 + 8N = A

Equivalent formula isolating the number of bonus spells N as a function of the spell level L and your ability score bonus B in your casting ability (always round down):

N=(B-L)/4+1

For example, if you have 24 Int, B=7 and you have (7-1)/4+1=2.5=2 bonus level 1 spells, and (7-4)/4+1=1.75=1 bonus level 4 spells.

redking
2023-11-12, 10:52 AM
Thank you all. Now to get it working in JavaScript.

Crake
2023-11-12, 06:50 PM
Thank you all. Now to get it working in JavaScript.

Just use floor on the returned value, and get max of the returned value or 0, so you dont end up with negative numbers

Feantar
2023-11-12, 08:21 PM
If you want it in javascript, this seems to work; I've tested it with random values (see the second line). Just be careful to use backticks (`) if you want to use template literals (ie, the ${variable} things). You can't imagine how many times I've gotten that wrong.



var SCORE = Math.floor(Math.random() * (250)) ; //Randomly Determine Score
var BonusSpells = new Array(9).fill(0); //Default Bonus spells of all levels are zero

if (SCORE <= 11)
{
console.log(`You get no bonus spells for a Spellcasting score of ${SCORE}, as it is bellow 12`);
}
else
{
var Modifier = Math.floor((SCORE -10)/2); //Modifier is Score - 10, divided by two, rounded down.
console.log(`You have a Spellcasting score of ${SCORE}, therefore your Modifier is ${Modifier}. Therefore, your bonus spells per level are:\n`)

var headings = ""; var boni = ""; //Just creating the two lines of the printed table.
for (let i = 0; i < BonusSpells.length; i++)
{
//The Max function is so that you can't get negative bonus spells due to subtraction.
BonusSpells[i] = Math.max(Math.ceil((Modifier-i) /4),0)
// Adding entries into the array, with tab separators; unless you go to stratospheric levels, they are enough to keep things neat.
headings = headings + `${i+1}\t`
boni = boni + `${BonusSpells[i]}\t`
}
//And do a nice printout.
console.log(headings); console.log(boni);
}


Sample output:


You have a Spellcasting score of 162, therefore your Modifier is 76. Therefore, your bonus spells per level are:

1 2 3 4 5 6 7 8 9
19 19 19 19 18 18 18 18 17