Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD

Notices

Reply
 
Thread Tools Display Modes
Brolthemighty
Senior Member
 
Join Date: Jan 2013
Posts: 273

Old November 13th, 2019, 10:30 PM
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.
Brolthemighty is offline   #1 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old November 14th, 2019, 02:12 PM
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.
dungeonguru is offline   #2 Reply With Quote
Brolthemighty
Senior Member
 
Join Date: Jan 2013
Posts: 273

Old November 14th, 2019, 06:03 PM
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 by Brolthemighty; January 12th, 2020 at 11:40 PM.
Brolthemighty is offline   #3 Reply With Quote
Brolthemighty
Senior Member
 
Join Date: Jan 2013
Posts: 273

Old January 12th, 2020, 11:59 PM
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?
Brolthemighty is offline   #4 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old January 13th, 2020, 07:25 AM
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?
dungeonguru is offline   #5 Reply With Quote
Brolthemighty
Senior Member
 
Join Date: Jan 2013
Posts: 273

Old January 13th, 2020, 02:34 PM
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 by Brolthemighty; January 13th, 2020 at 08:00 PM.
Brolthemighty is offline   #6 Reply With Quote
Brolthemighty
Senior Member
 
Join Date: Jan 2013
Posts: 273

Old January 13th, 2020, 08:01 PM
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
Brolthemighty is offline   #7 Reply With Quote
Brolthemighty
Senior Member
 
Join Date: Jan 2013
Posts: 273

Old January 13th, 2020, 08:05 PM
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.
Brolthemighty is offline   #8 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old January 14th, 2020, 05:24 AM
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 by dungeonguru; January 14th, 2020 at 05:26 AM.
dungeonguru is offline   #9 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old January 14th, 2020, 05:37 AM
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]
dungeonguru is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:24 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.