• 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

Add spells to spell list based on background

Fenris447

Well-known member
The Ravnica file is coming along, but there's one major nut that I have yet to crack. The backgrounds grant specific cantrips and spells to any caster (Locks included) with that background. These are not free spells; they're simply added to that caster's existing spell list.

How do I do it? I honestly have no idea where to start. I've thought something similar to the spells granted by Domains or Circles, or maybe something like racial spells (though those are usually granted as 1/long rest or similar). But how do we check to see if they're a caster, half caster, third caster, and/or pact magic?
 
You might want to take a look at how the Death Domain cleric allows the adding of bonus cantrips. It is a bit kludgy but it is the only way that I, thanks ti ShadowChemosh, found to do something like you are asking.

Basically, it allows you to pick a cantrip from a list, then you have to go to where you add your spells and add it (them) there.
 
That pointed me in the right direction, thanks! We don't need to worry about making them select the spell, since all we need is for the spell to be available in their spell list if they want it. Think Warlock subclass style; it's not automatically chosen, just another option when selecting your spells.

So the Reaper ability in the Death domain has a drop-down to select from a list that it generates in the usrChosen1 field. The eval script then does this:

Code:
      ~ Pull the spells Class Allow tag
      perform field[usrChosen1].chosen.pulltags[ClsAllowSp.?]

      ~ Set the Class Allow Tag onto the class
      perform root.linkage[table].pushtags[ClsAllowSp.?]

I don't know exactly how that root.linkage thing works, but I think since this ability is bootstrapped to the subclass/class special, that command sets the focus back to the class itself. Since ours is a background feature, I don't think we can use this root linkage functionality, right?

What we need instead is to list out the spells (I'm using spMessage and spCommand for the purposes of testing), pull each of their tags, then push them to every class on the Hero. If someone can help me with the code to just do one spell, I'll be able to take it from there with all the rest of them.

Code:
     ~pull the ClsAllowSp tags of spMessage
     ~add those ClsAllowSp tags to every class present on the Hero


TL;DR How do we pull the tags of a predetermined spell, then push those tags to ClsAllowSp in every class on the hero?
 
Last edited:
TL;DR How do we pull the tags of a predetermined spell, then push those tags to ClsAllowSp in every class on the hero?
In this case you don't need to PULL tags because you can just assign the tags directly to the Thing that will execute the script. Do this using the blue button named "Tags" in the editor.

Then to push those tags to all classes do a foreach loop:
Code:
foreach pick in hero from Class
  perform eachpick.pushtags[ClsAllowSp.?]
  nexteach

The above loops through each Class Helper Pick that is live on the character and pushes all the ClsAllowSp tags to them.
 
Back
Top