View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 21st, 2009, 06:30 PM
Consider it from the other angle - "my DM says I can take this feat to give me DR 1/- even though I don't get DR from another source" - a user had to intentionally select a feat, so I'd give them the benefit of the doubt, and not bother checking for the pre-reqs inside the script.

Handling the fact that the feat satisfies its own pre-req - don't bother with something that complex if you're just trying to get a book entered for use. For completeness, here's what I've got (go back to a pre-req for this):

if (@ispick <> 0) then
@valid = hero.childfound[xDamRd].tagis[Helper.ShowSpec]
elseif (hero.childfounc[xDamRd].field[Value].value >=2) then
@valid = 1
end

Walking through that:

First, ask whether we're a pick (if we're still in the feat selection dialog) - if so, all we need is that the xDamRd special is out there, and displayed (which means it has a positive value). Otherwise, we ask whether xDamRd's value is greater than the +1 this feat is adding, if so, we're good. If it doesn't meet either of those, the if...elseif...end will complete, and the pre-req will complete, leaving @valid = 0, which is what it always starts a pre-req script set to.

P.S. I haven't tested that or looked up references, I may have gotten reversed on whether you need @ispick = 0 or @ispick <> 0.
Mathias is online now   #4 Reply With Quote