• 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 weapon focus for free based on simple vs martal weapon

ebpatton

Well-known member
I would like to somehow like to add Weapon Focus as a bonus feat for a cleric offshoot class I've created, but only if (a) the cleric has a deity, and (b) the deity's favored weapon is simple. (Weapon Focus would then be added for free for this weapon.)

How can I do this?
 
If you're not using both Bonus Feat tables I would probably have a bonus feat table with that being the only feat selectable and have a script that only adds 1 to the max of the table if it meets those requirements.
 
I'm trying to do something easier just to see how the programming works. Although it's not what I ultimately want, I'm trying to add free Weapon Focus to the new class with the deity's favored weapon.

I know how to add WF. It seems to me as if I should add something under "Fields..." to make WF automatically apply to the deity's favored weapon. And it seems like "Value" under Fields would be "cClrDeiWep". If all this is correct (which it may not be), what is the "Field ID"?
 
I'm not sure this will work, but it's an idea

Code:
     ~get the deity's favored weapon
     var tagexpr as string
     tagexpr = hero.findchild[Deity].tagids[WepProf.?," | "]
     tagexpr &= " & wProfReq.Simple"
     ~look through weapons and check if they are the favored weapon and if they are simple
     foreach pick in hero from BaseWep where tagexpr
       perform eachpick.assign[Broadcast.WepFocus]
     nexteach

What it does is gets the id for the favored weapon off the Deity, Creates a tag expression consisting of the favored weapon and the tag that denotes it as a simple weapon the goes through each weapon that meets those criteria and assigns the Broadcast.WepFocus tag to it which is what Weapon Focus does. The only catch with this method is you gain the effects of weapon focus but you don't actually gain the feat which would require a bit more work.
 
Would it be the case that whatever I do needs to be an "Eval Script"?

I mean, logically, I know what it ultimately needs to be. Something like

If (deity's favored weapon is simple) then
Add weapon focus with deity's favored weapon
Ignore weapon focus prerequisites
End If

I just don't understand the objects well enough to know what things are called, or where scripts should go. I'm looking at all sorts of things to see examples of how to do things, and it's helped some. But I still don't know what all the objects are or what I can do with them.
 
I'm trying an empty If statement just to understand syntax:

Code:
if (cClrDeiWep.wmSimple is true) then
end if

It won't compile though, nor if I replace "is true" with "<> 0".
 
The script I showed you above has the bare minimum you're going to need to check if a weapon is the deity's favored weapon and simple.

You have the check the deity to find it's favored weapon, not the cleric special.

In my script that is what the line

Code:
tagexpr = hero.findchild[Deity].tagids[WepProf.?," | "]

It goes and finds the deity on the character and then creates a variable containing it's favored weapon. I then amend " & wProfReq.Simple" so that the expression contains the deity's favored weapon and it requires simple weapon proficiency.

It then goes through all the weapons on the character and applies the benefits of weapon focus to the weapons that meet that criteria. Are you actually wanting them to gain the feat, because that can be done as well.
 
But isn't there already a container or pre-defined variable for the deity's favored weapon? Isn't that what cClrDeiWep is? A reference to the favored weapon of the deity selected by a cleric?
 
cClrDeiWep can be broken down as such

c = class/class ability
Clr = cleric
DeiWep = Ability Specific name

In this case cClrDeiWep is a the clerical class ability that grants proficiency with the Deity's Favored Weapon

if you copy this special you'll see that it assigns the tag Hero.DeityWeap to the hero. That tag has some background script that runs when it's found that assigns the proficieny with the favored weapon.
 
When I test your code, I get the following:

"Invalid tag expression specified for 'foreach' statement."

But it otherwise seems to compile okay. What is it flagging the error for?
 
I put it into an Eval Script for a new class (a copy of the cleric class). I don't actually understand your question. What does ability refer to in the context in which you're using it?
 
By ability I meant what kind of thing did you put it on, Class Ability, Racial Ability, Feat, etc. You put it on the class (I'm assuming the class Helper).
 
Ok here's a slightly modified code that stops it from running if you don't have a deity selected (which is why you were getting the error)

Code:
     ~get the deity's favored weapon
     var tagexpr as string
     tagexpr = hero.findchild[Deity].tagids[WepProf.?," | "]
     doneif (compare(tagexpr,"") = 0)
     tagexpr &= " & wProfReq.Simple"
     ~look through weapons and check if they are the favored weapon and if they are simple
     foreach pick in hero from BaseWep where tagexpr
       perform eachpick.assign[Broadcast.WepFocus]
     nexteach
 
How would I see the effects of this script manifested in the character? I would assume if the character were wielding, say, a longsword (for a cleric of Iomedae), then at level 1 he'd have a +1 modifier on his attack rolls. But I'm not seeing that.

It seems though that, if your script already does most of the hard work, assigning the WF feat with the appropriate weapon wouldn't be too much more work.
 
Longsword is not a simple weapon therefore Clerics of Iomedae would no get the benefits of weapon focus. Try Abadar with a Light Crossbow.
 
Back
Top