Modifying Spells Per Day
Ameranthftw
Member Posts: 57
I've been trying to use the "Bonus wizard spells (42)" opcode to lower the spell progression of a kit I've been making. Essentially I used a single spell file, with different abilities that each have a different minimum level (1, 2, 3, ...). Each of these abilities have effects which lower the amount of spells cast per day for various spell levels as an Instant/Permanent effect.
Originally, I was simply applying these each level, stack them upon one another, but eventually (once I started adding spells per day to undo previous negative spells per day), the spell per day amounts got really crazy. This bug in mind, I tried to have each prospective effect level handle all of the negative spells per day of each level on its own (no more effect stacking), and I used the "Remove effects by resource (321)" opcode to undo previous levels of this effect before applying the new one.
Here is where I have my problem, even if I remove the effects of the ability (we'll call it NEGSPD.spl) before I apply the next one, the next one leaves no effect. Even if I use a second ability to first remove effects of NEGSPD.spl and cast NEGSPD.spl after a short delay (using opcode "Cast spell (146)" with delay/permanent duration of 1) , there is no effect from NEGSPD.spl.
Now I believe I could just use a different spell file for each level, but it's really an inelegant solution, so if anyone could help me figure it out without doing that, I would be really grateful
Originally, I was simply applying these each level, stack them upon one another, but eventually (once I started adding spells per day to undo previous negative spells per day), the spell per day amounts got really crazy. This bug in mind, I tried to have each prospective effect level handle all of the negative spells per day of each level on its own (no more effect stacking), and I used the "Remove effects by resource (321)" opcode to undo previous levels of this effect before applying the new one.
Here is where I have my problem, even if I remove the effects of the ability (we'll call it NEGSPD.spl) before I apply the next one, the next one leaves no effect. Even if I use a second ability to first remove effects of NEGSPD.spl and cast NEGSPD.spl after a short delay (using opcode "Cast spell (146)" with delay/permanent duration of 1) , there is no effect from NEGSPD.spl.
Now I believe I could just use a different spell file for each level, but it's really an inelegant solution, so if anyone could help me figure it out without doing that, I would be really grateful
0
Comments
EDIT: Unfortunately this doesn't seem to make a difference, even with the delayed application of the spell.
What I would do is give compatibility with more well-known mods, BG2tweaks' components being the one that I think of. Other mods can be up to the prospective user to handle, or of course request for compatibility.
I did manage to circumvent this--have a spell remove the spell-per-day-modifying spell's effects, as well as cast a second spell, which serves as only a bridge for casting the third spell that modifies spells per day.
Using this method, it is possible to only use three spell files for modifying whatever amount of character levels, which I think beats the alternative to one spell file per character level.
I used his filename, "NEGSPD", as a placeholder, it can be replaced with whatever filename you want, it just needs to be an empty spell file - no abilities or effects. Setting a minimum value will only prevent it from removing all spells from a given level, it will not add spells if there are less.
The current options, 2 0 1, will remove 2 spell slots per level, but not to less than 1 slot. Equivalent to getting 1 less slot per spell level for a Mage/Sorcerer kit, as they get a hardcoded +1 slot per level)
Option: 0 1 0, will reduce all spell slots at every level to 0 (not including bonus slots from wisdom or equips).
For what you proposed, to edit the spell table and give each kit a +1 bonus instead ... I can fix that. A bit of a quick mess, currently it will not work correctly if 2 or more spells reach their 2nd slot at the same level. Cleaned it up a little. But otherwise I think this is what you wanted:
BTW, that bug only occurs when combined with equipment that add/remove spell slots. Hardcoded kit bonuses and permanent effects combine just fine.