• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Limited Spell Casting

spannclann

Well-known member
I am creating a Martial Archetype and I am having some trouble adding limited spell casting.

I have specific spells in mind that the Archetype will get access to at certain levels and I know how to assign those spells.

My issue is how do I make it to where they only get a limited number of spell slots for casting.

For instance, at level 5, the Archetype will get access to spell x and spell y, but will only have 1 spell slot available to cast a spell.
At level 7, the Archetype will get access to spells w,x, y and z, but will only have 2 spell slots available to cast a spell.

Would using this eval script from the Eldritch Knight Archetype be the way to go? The code in red is code I believe I do not need...


perform linkage
.setfocus

doneif (state.isfocus = 0)

~ Spellcasting attribute
perform focus.setlinkage[castattr,BaseAttr,"IsAttr.aINT"]

~ Spellcasting type
perform focus.assign[CasterType.SpontKnow]
perform focus.assign[CasterSrc.Arcane]
perform focus.assign[Helper.3rdCaster]
perform focus.assign[sClass.cHelpWiz]

~ Cantrip Array
focus.field[cArrKnCan].arrayvalue[2] += 2
focus.field[cArrKnCan].arrayvalue[9] += 3

~ Spells Known Array
focus.field[cArrKnSpl].arrayvalue[2] += 3
focus.field[cArrKnSpl].arrayvalue[3] += 4
focus.field[cArrKnSpl].arrayvalue[6] += 5
focus.field[cArrKnSpl].arrayvalue[7] += 6
focus.field[cArrKnSpl].arrayvalue[9] += 7
focus.field[cArrKnSpl].arrayvalue[10] += 8
focus.field[cArrKnSpl].arrayvalue[12] += 9
focus.field[cArrKnSpl].arrayvalue[13] += 10
focus.field[cArrKnSpl].arrayvalue[15] += 11
focus.field[cArrKnSpl].arrayvalue[18] += 12
focus.field[cArrKnSpl].arrayvalue[19] += 13

~ Max Spell Levels Array
focus.field[cArrKnLev].arrayvalue[2] += 1
focus.field[cArrKnLev].arrayvalue[6] += 2
focus.field[cArrKnLev].arrayvalue[12] += 3
focus.field[cArrKnLev].arrayvalue[18] += 4
 
The lines you highlight in red only control the number of spells or cantrips known at a given level, not the slots.

Slots are determined by the caster helper:

perform focus.assign[Helper.3rdCaster]


This is all baked in the base code so you need to pick a caster type that is closest to the number of slots you want and start from there. The types are: WarlocCast, FullCaster, HalfCaster, or 3rdCaster

Look at the Boon of High Magic - it adds a single 9th level spell slot with the line:

hero.childfound[SlotHold9].field[MaxAllow].value += 1

You can see that SlotHold9 is the container for 9th level spells on a character. This means you'll have to write a script that runs and checks for caster level and then adds and removes to all 9 of the SlotHold values. It's a lot of work for anything more than a 1/3rd caster like the eldritch knight.

For warlocks, the code is slightly different.

hero.childfound[SlotHoldWa].field[MaxAllow].value += 1

Since warlocks only have a single spell slot pool, it's a bit easier to modify this part of their spellcasting.

Hope that gets you started.
 
@dungeonguru

I am using the Warlock type of spell slot pool. I was curious if there was a code to change the word Warlock to something else?

Spell Slots.PNG
 
Back
Top