• 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

Favored class script?

mbran01

Well-known member
I am trying to add the Arcane Schooling feat from the Forgotten Realms. It lets you choose an arcane spellcasting class and then adds that class as a favored class in addition to any others that have.

I was able to copy the script from the Half-elf's mutlitalented ability, but that lets you choose from any class. What I was wondering is if there was a way to limit the choices to just the bard, sorcerer, or wizard. Maybe limit them in the feat and then use that choice to add the favored class.

Thanks for any help you might be able to provide.

Michael
 
You can give your feat a chooser that picks among those classes class helpers, and then does a foreach to cycle through the associated class levels (NOT the helpers) to assign the Helper.FavorClass tag to them. I think that should be able to do it.
 
I can't seem to get it to add just the three classes. I can get all arcane spellcasters or all classes.

This gives me all arcane classes
component.BaseClHelp & CasterSrc.Arcane

I have tried a few variations using cHelpBrd | cHelpSor | cHelpWiz
which seems that obvious choice (to me).

Anyway thanks for you help. I am not much of coder, but I can usually manage by borrowing other code and adjusting it. I have not been able to get the dang chooser to work though.
 
Also could you take a look at my script for the favored class part of the feat. It works (sort of). If I add the feat before choosing a favored class and choose my class in the feat, then the class is treated as a favored class. As soon as I choose my favored class on the classes tab then my feat selection is no longer treated as a favored class.

I modified the code from the weapon focus feat (I think, could have been weapon spec or something else I was going through a lot of code)

And again thanks in advance for looking at this and providing any help that you can.

~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)

if (field[usrChosen1].ischosen <> 0) then

~ Assign the appropriate tag to all classes that meet the criteria
var result as number
var id as string
id = field[usrChosen1].chosen.idstring
foreach pick in hero where "IsClass." & id
result = eachpick.assign[Helper.FavorClass]
nexteach

~ Forward the favored class tag for the class to the hero
result = field[usrChosen1].chosen.forward[Helper.FavorClass]
endif
 
Well it's not exactly what I was looking for but this works...

I added multitalented to the character using a script and then created an eval rule that looks for the bard, sorcerer, or wizard to be a favored class.
 
Well I am like a dog with a bone I guess, and I couldn't let it go. I am still playing with this. I am trying different things to get the favored class tag for the class added to the hero.
 
Well I still can't get this to work. I am posting what I have so far so someone can take a look at it. For now I am just adding the mutlitalent ability (script from multitalent half-elf racial ability).

var name as string
~assign bard as a favored class
if (field[usrChosen1].chosen.pulltags[thingid.cBard] = 1) then
foreach pick in hero where "IsClass.cBard"
perform eachpick.assign[Helper.FavorClass]
nexteach
~assign sorcerer as a favored class
elseif (field[usrChosen1].chosen.pulltags[thingid.cSorcerer] = 1) then
foreach pick in hero where "IsClass.cSorcerer"
perform eachpick.assign[Helper.FavorClass]
nexteach
~assign wizard as a favored class
elseif (field[usrChosen1].chosen.pulltags[thingid.cSorcerer] = 1) then
foreach pick in hero where "IsClass.cSorcerer"
perform eachpick.assign[Helper.FavorClass]
nexteach


~ Set our 'short name'
field[shortname].text = "Arcane Schooling: " & name


endif
 
Well, I got it to work. Here is what I came up with.

phase/priority (levels/100)

Code:
~assign Bard as a favored class
if (field[usrChosen1].chosen.pulltags[thingid.cBard] = 1) then
perform hero.assign[FavClass.cBard]
perform hero.childfound[cBard].assign[Helper.FavorClass]
 
~assign Sorcerer as a favored class
elseif (field[usrChosen1].chosen.pulltags[thingid.cSorcerer] = 1) then
perform hero.assign[FavClass.cSorcerer]
perform hero.childfound[cSorcerer].assign[Helper.FavorClass]
 
~assign wizard as a favored class
elseif (field[usrChosen1].chosen.pulltags[thingid.cWizard] = 1) then
perform hero.assign[FavClass.cWizard]
perform hero.childfound[cWizard].assign[Helper.FavorClass]
endif
 
Last edited:
Back
Top