TemplePlus icon indicating copy to clipboard operation
TemplePlus copied to clipboard

Bonus Spell Slots

Open dolio opened this issue 4 years ago • 9 comments

This came up in a PR discussion.

It'd be useful to be able to have conditions that provide bonus spell slots. Things that would use that are, at least, Rary's Mnemonic Enhancer and Precocious Apprentice.

In browsing the original code, it looks like one of the dispatchers might have been intended to support this (my recollection was maybe 57 or 58). However, if that was the case, it got dropped.

dolio avatar Jul 17 '21 03:07 dolio

Noting: Dragon Disciple would use this.

dolio avatar Jul 31 '21 00:07 dolio

Noting: Dragon Disciple would use this.

Very prescient 😆

DudeMcDude avatar Sep 22 '21 18:09 DudeMcDude

So assuming we add a dispatch for this:

  1. What info should be sent out in the event object? I'm guessing class enum is enough.
  2. I'm thinking the event object should contain a list of bonus slots per level, and the recipients should be able to increment (or decrement, for stuff that requires sacrificing slots e.g. archmage).

Thoughts? Pinging @Sagenlicht @doug1234 @anatoliy-savchak @shartte

DudeMcDude avatar Sep 22 '21 18:09 DudeMcDude

Another use case is rings of wizardry.

What those do is double your inherent number of slots for a given level. However, it only doubles the base number. So, a 3rd level specialist wizard with a ring of wizardry 1 would get 2 extra 1st level slots. They wouldn't get 3, because the specialist slot is not doubled, and also the bonus slots from high intelligence aren't doubled.

So, the callback needs to be able to tell how many (effective) levels of the relevant class the character has. I guess that's easily available with just the class enum, though.

dolio avatar Sep 22 '21 18:09 dolio

So assuming we add a dispatch for this:

  1. What info should be sent out in the event object? I'm guessing class enum is enough.
  2. I'm thinking the event object should contain a list of bonus slots per level, and the recipients should be able to increment (or decrement, for stuff that requires sacrificing slots e.g. archmage).

Thoughts? Pinging @Sagenlicht @doug1234 @anatoliy-savchak @shartte

Sounds great, don't think more is needed.

Sagenlicht avatar Sep 22 '21 20:09 Sagenlicht

Looks good

anatoliy-savchak avatar Sep 23 '21 07:09 anatoliy-savchak

This would also be used by loremaster

AugustDrake avatar Oct 23 '21 15:10 AugustDrake

I've re-integrated event type 58 (in python now called ET_OnGetSpellsPerDayMod), which was sort of used for this. Curiously, it was only used for Sorcerer Spells Per Day, and then only as part of the Action Check for casting. However no condition actually reacted to this event, so might as well repurpose it.

The relevant event object is: (type 18)

https://github.com/GrognardsFromHell/TemplePlus/blob/c2f7bd33c269a076177391c508062b5bee7695f3/TemplePlus/python/python_dispatcher.cpp#L1176

Though come to think of it, most of the fields should be read only, heh.

Can anyone verify it's working as intended?

DudeMcDude avatar Oct 25 '21 17:10 DudeMcDude

Sweet!

dolio avatar Oct 25 '21 17:10 dolio