• 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

Book of Shadows....item

Brolthemighty

Well-known member
Alright, so I'm looking at tempting one of my players towards damnation by slowly corrupting them throw attaining knowledge and power. Namely, a Book of Shadows/Book of Ancient Secrets.

I started out with just creating an item that functioned as a Book of Ancient Secrets. No problem there actually, just created a Wondrous item and bootstrapped it on. It created a new tab where they could add ritual spells from all lists. Cool.

I realized I started this bass ackwards, so removed the bootstrap, and then bootstrapped on the Book of Shadows and removed the requirement of Warlock. That...didn't work out as well. It has an eval script that references a table. No idea what the table is, or what I should be adding in/removing to take care of it.
 
The warlock stuff like that invocation and pact of the tome all uses variables that start with a "c" - which means they are "class" fields, variables and tables and expect in those cases the warlock class

Trying to modify or adapt them is likely to fail on non-warlocks or cause weird effects because the warlock method of adding spells is completely different from the rest of the classes.

I would suggest looking at the feat Magic Initiate and the associated configurable. The configurable is what actually sets up a new tab and spell selection lists and would allow for not using Charisma.
 
I’ll try going that route, thank you :)

Okay, long overdue update/edit:

So I've looked at Magic Initiate but for the life of me I can't seem to make it work. I have created the wondrous item with zero scripts, and it shows up fine. Using Magic Initiate as a template I created a new configurable. Only thing I changed was in the first Eval script where it said Magic Initiate I changed to my item's name, and where it used MI's user ID and changed it to my configurable's. I was able to save, and "Test" it, and it compiled fine. Bootstrap it to the item, compiles fine, doesn't actually do anything.

Try bootstrapping the magic initiate feat to the item. Also nothing. Take ALL of the stuff from Magic Initiate, and put it in my item. Changed where MI's script referenced the MI configurable and changed it to mine. Now it pulls up my configurable, BUT since it's all the same script work, there's the same issue with being restricted by class lists.

Trying to add 2 Cantrips and 1 1st level spell known, without restricting it to a single list (Kinda like Arcane Secrets) while using the casting stat of the person with the item.
 
Last edited:
Bump? I'm not sure if that's allowed or not. I'll delete if not...just had some new progress with new questions. Sorry? Thank you?
 
It's OK to bump for questions.

To help more, can you post your .user file or at least copy the items out using notepad and pasting them into the post?

Then explain what's working the way you want it, and what's not?

I think you just want the item to grant two cantrips and 1 spell, which aren't restricted to ritual or any particular class. Is the spell restricted to 1st level though?
 
That’s the gist of it yeah. The spell is at a level they can cast, so 1st or 2nd, not restricted by class lists. I was just going to call it good if I could get a 1st one done. Once I can get it pulled up on my laptop later, I’ll post the coding. It’s essentially the same as Magic Initiate.

I was going to upload the file, but couldn't figure out how. I'll go ahead and post what I believe is the relevant codes, but it's a lot:

Item
Book Id: EP5CBkShdwFlm
Bootstrapped: EP5CcfgBkShdwFlm
Custom Expression: component.Class & CasterSrc.? & (Helper.FullCaster|Helper.WarlocCast)

Eval Script:
First/10000/1


~ If we're disabled, do nothing &
doneif (tagis[Helper.Disable] = 1)
~ If nothing chosen then get out now!
doneif (field[usrChosen1].ischosen = 0)

~ Make the Spells tab appear
perform hero.assign[Hero.Caster]

~ Get the ability score and the Spell Class tags
perform field[usrChosen1].chosen.pulltags[PrimeAbil.?,StandardDC]
perform field[usrChosen1].chosen.pulltags[sClass.?]

~ Set the ability score and spell tags onto the configurable
perform hero.childfound[EP5CcfgBkShdwFlm].pushtags[StandardDC.?]
perform hero.childfound[EP5CcfgBkShdwFlm].pushtags[sClass.?]

~ Set the total number of spells allowed (ie 2 which is .5 for each
~ cantrip and 1 for 1st level spell).
hero.childfound[EP5CcfgBkShdwFlm].field[cfgMaxSp1].value += field[abValue5].value

~ Remove the Staandard DC tag from this feat
perform delete[StandardDC.?]
 
Last edited:
Configurable Id: EP5CcfgBkShdwFlm
First Eval
Final Phase/50000/1


~ If no spell class tags, do nothing &
doneif (tagcount[sClass.?] = 0)

~ NOTE: I am thinking I found more bugs in 5e game system as
~ I shouldn't have to do this to get spells to appear
~ on the "Spells" tab.

~ Generate SpellSort and SpellType tags
perform pulltags[sClass.?,SpellSort]
perform pulltags[sClass.?,SpellType]

~ Loop through all the spell picks added on the "Book of Shadow and Flame"
~ Configurable tab.
foreach pick in hero from BaseSpell where "CfgSpell.EP5CcfgBkShdwFlm"

~ Set the SpellSort and SpellType tags which are needed
~ to get spells to display correctly on the Spells tab
perform eachpick.pushtags[SpellSort.?]
perform eachpick.pushtags[SpellType.?]

~ Pull the spell level selected and the deny tags so that
~ we can set the message and selection list corretly.
perform eachpick.pulltags[sLevel.?]
perform eachpick.pulltags[ClsDenySp.?]

~ If we are a cantrip add the helper cantrip tag
if (eachpick.tagis[sLevel.0] = 1) then
perform eachpick.assign[Helper.Cantrip]

~.. otherwise we are level 1+ spell so make us a
~ racial spell so we can limit its use to 1/longrest
else
perform eachpick.assign[Helper.SpellLike]
perform eachpick.assign[Usage.LongRest]
eachpick.field[trkMax].value += 1
endif
nexteach

~ Set the spell selection expression to only be the selected class
field[cfgAllwSp1].text &= " & (sLevel.0|sLevel.1) & (" & tagids[sClass.?,"|"] & ") & !Helper.Helper"

~ If we have Class Deny Spells then remove those from the list. This
~ prevents the same spell from being added twice. This way we act
~ like the normal spell portal does.
if (tagcount[ClsDenySp.?] <> 0) then
field[cfgAllwSp1].text &= " & !(" & tagids[ClsDenySp.?,"|"] & ")"
endif

Eval 2
Tags: Helper/ClsCastLev and Helper/SpCountLev


Render/2147483647/2

var nLevel0 as number
var nLevel1 as number

~ Calculate the number of spells selected
nLevel0 = 2 - tagcount[sLevel.0]
nLevel1 = 1 - tagcount[sLevel.1]

~ Set the correct message
If (nLevel0 + nLevel1 > 0) then
field[cfgAdTxSp1].text = "Add " & nLevel0 & " Cantrips and " & nLevel1 & " 1st-level spell"

ElseIf (nLevel0 + nLevel1 = 0) then
field[cfgAdTxSp1].text = "No more spells to add."

ElseIf (nLevel0 < 0) then
field[cfgAdTxSp1].text = "You have " & tagcount[sLevel.0] & " of 2 cantrips allowed."

ElseIf (nLevel1 < 0) then
field[cfgAdTxSp1].text = "You have " & tagcount[sLevel.1] & " of one 1st-level spell allowed."
Endif
 
This is what I've got. If I could just figure out what part of it needs changed/taken out so that it doesn't restrict to class list.
 
Well, I've played with it overnight and I think I might have a solution for you that drops the class restriction and allows you to select a caster attribute instead.

If you're OK with just 2 cantrips and 1 1st-level spell (for now), the configurable is fine as is. I'll try to highlight where those sort of changes need to be made.

The Wondrous Item will need the following changes:
1. You'll want to add tags for every spell casting class that you want to see spells for to the Wondrous item.
GroupID: sClass Tag ID: cHelpWiz
for wizard, etc.
(sClass tag IDs are: cHelpClr, cHelpDrd, cHelpPal, cHelpRgr, cHelpSor, CHelpWlk, and cHelpWiz) (Cleric, Druid, Paladin, Ranger, Sorcerer, Warlock and Wizard - if you have an alchemist class use its cHelp### too).

2. Remove the custom expression and set the Item Selection fields as follows:
Select From.... Choose Attributes
Restrict First List To... Choose All Picks on Hero

3. Change the scripts a bit.

Script #1, First/10000, index 1
~ Get out if we're not attuned (I assume this item needs attunement)
doneif (field[gIsAttuned].value = 0)
~ If nothing chosen then get out now!
doneif (field[usrChosen1].ischosen = 0)

~ Make the Spells tab appear
perform hero.assign[Hero.Caster]

~ Pull tags for the casting attribute
perform field[usrChosen1].chosen.pulltags[PrimeAbil.?,StandardDC]

~ Push tags we need to the configurable
perform hero.childfound[EP5CcfgBkShdwFlm].pushtags[StandardDC.?]
perform hero.childfound[EP5CcfgBkShdwFlm].pushtags[sClass.?]

~ Set the total number of spells allowed (cantrips count as 1)
~ so 2 for 2 cantrips + 1 for 1 1st level spell
hero.childfound[EP5CcfgBkShdwFlm].field[cfgMaxSp1].value += 3
This used to be hero.childfound[EP5CcfgBkShdwFlm].field[cfgMaxSp1].value += field[abValue5].value but I'm hardcoding to 3 here because I didn't see where you were setting it.
~ Remove the Standard DC tag from this feat
perform delete[StandardDC.?]

Observation
This seems to work fine in my test scenarios, but I can see a possible issue where the cantrips list out all the classes you've added for every spell list, I'm not sure if this is too cluttered for what you're wanting. There's some code you can play with in script #1 on the configurable to work with that boils down to how you want these spells to display on the UI (the pushtags SpellSort and SpellType lines).

Expanding to 2nd level spells
In order to expand this out to include 2nd level spells, you'll need to adjust the value you're sending the configurable in the script above on the item and then modify script #2 on the configurable to allow for 2nd level spells. That's trickier but not impossible.
 
Last edited:
Added Thought

If you wanted to remove the clutter on the cantrips listing and list the spells out like a racial or spell-like ability instead, change the following in script #1 of the configurable where

if (eachpick.tagis[sLevel.0] = 1) then
perform eachpick.assign[Helper.Cantrip]

change that to

if (eachpick.tagis[sLevel.0] = 1) then
perform eachpick.assign[Helper.SpellLike]
perform eachpick.assign[Usage.AtWill]
 
Was finally able to sit down and try the script changes. Ended up getting this error:

Edit: NVM, it works! Thank you so much!

Edit Edit: Now using this as a base, is there a way to continue to add abilities onto that configurable's tab? Is it just bootstrapping those abilities onto the configurable?
 
Last edited:
Adding abilities via a dropdown or configurables is a lot more convoluted.

You *can* add abilities via a configurable but you have to know how to formulate your candidate expressions. You don't want to bootstrap the abilities since you would have to edit the configurable every time you add a new ability. It would be better to add a custom User Tag on an ability.

Let say you've copied a few abilities as Racial Abilities. On these abilities you added a tag: Custom.MyRacTag.

In order for a configurable to offer the choice to add one of these you would need to either put a 1 into one of the Racial Ability Total fields or have a script add 1 to cfgRcMax1 (for the Primary table). Your Primary Candidate Expression (cfgRcAllo1) would include "Custom.MyRacTag" and then the configurable should show all racials with that custom tag as selectable.

I've never gotten it to work cleanly so this is all theoretical though.

If you can get this to work, you might want to add this configurable to an Adjustment if you don't want to add it to a Wondrous item (to answer the other question you posted as well).
 
Alright. Dang I was hoping that it wasn’t going to take that much, but I should’ve figured that “seems simple” would’ve been wrong. Maybe just doing a bunch of wondrous items for each ability might not be so bad lol.

Really appreciate your input
 
Last edited:
Back
Top