• 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

Adding bonus spells to spell list

Sendric

Well-known member
Ok, I'm getting stuck on doing this even though I swear I've done it before. What I am doing is using a class special to chose a spell from a specific list, then add that spell to the caster's spell list. In this case, its choosing from the wizard spell list and adding to the cleric spell list.

In Pathfinder, the following code adds a chosen spell to a spell list (ala Unsanctioned Knowledge feat):

Code:
if (field[usrChosen1].ischosen <> 0) then
  ~Add our spell to the spell list
  perform field[usrChosen1].chosen.pulltags[ClsAllowSp.?]
  perform hero.childfound[cHelpPal].pushtags[ClsAllowSp.?]
endif

Sadly, this doesn't work in d20 since HL doesn't know what ClsAllowSp is.

I also tried this:

Code:
perform field[usrChosen1].chosen.assign[sClass.Cleric]

It compiled, but I got the following error after choosing a spell:

Attempt to access pick information or behaviors for read-only thing 'sWizAlarm'

I know I'm missing something simple. Anyone know what I can do here?
 
Try adding some ClsAllowSp tags to a Pathfinder class, and then study the text in various fields - you'll see those tags show up in one expression or another.

You should be able to manually generate similar field text for d20, using thingid tags in place of ClsAllowSp tags.
 
Try adding some ClsAllowSp tags to a Pathfinder class, and then study the text in various fields - you'll see those tags show up in one expression or another.

You should be able to manually generate similar field text for d20, using thingid tags in place of ClsAllowSp tags.

Well, I can see the changes to the fields cSpellExpr and cSplScExpr, but I'm apparently too dense to figure out how to use that to my advantage. Is that what you're pointing me towards?
 
Those are the fields I was referring to. Could you copy one of those examples here? I'll break down what's in that example, and help you rebuild that into a cSpellExpr field that will work for your d20 class.
 
Sorry for the delay. In Pathfinder, cSpellExpr looks like this:

before:
Code:
sClass.cHelpPal | Helper.CustomItem & !Hide.Spell & !Helper.Obsolete & !(component.EffectWord | component.MetaWord) & !Helper.Wordspell

after:
Code:
(sClass.cHelpPal) | (ClsAllowSp.spAlarm1) | Helper.CustomItem & !Hide.Spell & !Helper.Obsolete & !(component.EffectWord | component.MetaWord) & !Helper.Wordspell
 
In d20, the cSpellExpr for a Paladin is simpler:
Code:
sClass.cHelpPal | Helper.CustomItem

All that's saying is "find us all the spells that have the sClass.cHelpPal tag, or that have the Helper.CustomItem tag". The Helper.CustomItem tag only appears on "-Custom/Metamagic Spell-", so you'll get everything that's Paladin specific, and that custom/metamagic spell.

This part at the end is needed in Pathfinder to keep wordspells from showing up in the list - you'll delete this part in d20:
Code:
& !(component.EffectWord | component.MetaWord) & !Helper.Wordspell

The next part at the end is also not needed in d20:
Code:
 & !Hide.Spell & !Helper.Obsolete

That's two different ways of marking a spell as "don't use this". d20 doesn't have this capability.

Which leaves us:

Code:
(sClass.cHelpPal) | (ClsAllowSp.spAlarm1) | Helper.CustomItem

See how that's a variation of the same thing that was in d20? - "if we're a paladin spell, or we're spAlarm1, or we're the custom/metamagic spell, we're OK."

Pathfinder allows multiple sClass tags and multiple ClsAllowSp tags, which is why those are in parentheses. For example, you could have this:

Code:
(sClass.cHelpPal | sClass.cHelRgr) | (ClsAllowSp.spAlarm1 | ClsAllowSp.spMagiMis1) | Helper.CustomItem

Okay, like I said, you'll use thingid instead of ClsAllowSp in d20, and you need it to come AFTER post-levels/10000 (like post-levels/11000):

Code:
field[cSpellExpr].text = sClass.cHelpPal | thingid.spAlarm1 | Helper.CustomItem

If you're in a class special, then you'll need to travel to the correct class helper before setting the field value.
 
Thanks. All of that makes complete sense, but I'm not clear on how to capture the thingid from the chooser. The chooser is selecting from all Wizard spells from the Abjuration, Divination and Necromancy schools for a specific level (starting at 1st level spells), so there are a number of spells to choose from. I'm using Alarm as an example since its the first spell listed in the chooser. How do I pull the thingid from the chooser to plug into the cSpellExpr field? I tried creating a string variable and using pulltags or tagis, but both of those just gave me numerical results.
 
Last edited:
set your string variable to the chosen thing's unique ID

var chosenstr as string
chosenstr = field[fChosen].chosen.tagids[sClass.?," | "]

Then stick that into the field's expression
 
Aha! That's the ticket. Here's what I ultimately ended up with:

Post-levels 11000
Code:
doneif (field[usrChosen1].ischosen = 0)

var newspell as string

newspell = field[usrChosen1].chosen.tagids[thingid.?," | "]

hero.childfound[cHelpClr].field[cSpellExpr].text = hero.childfound[cHelpClr].field[cSpellExpr].text & " | "& newspell &" "

Thanks to both of you!
 
Last edited:
Back
Top