Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - d20 System (http://forums.wolflair.com/forumdisplay.php?f=46)
-   -   Damage Reduction +1 Modifier from Feat (http://forums.wolflair.com/showthread.php?t=8255)

bodrin February 21st, 2009 06:52 AM

Damage Reduction +1 Modifier from Feat
 
I've just entered the Greater Resiliency feat from the Complete Warrior this Eval Script for checking for Damage reduction works up to the point where it adds +1 to the Damage reduction

Code:

~ Check for Damage Reductiion as a Class or Innate Ability

hero.childfound[cBbnDR].field[hTotal].value += 2
    hero.childfound[cPfPTaDam1].field[hTotal].value += 2
hero.childfound[cDwDDR1].field[hTotal].value += 2

~ We passed, so add +1 to our total  Damage Reduction.
hero.child[xDamRd].field[hTotal].value = hero.child[xDamRd].field[hTotal].value + hero.child[xDamRd].field[hTotal].value + 1
done

hero.child[cBbnDR].field[hTotal].value = hero.child[cBbnDR].field[hTotal].value + hero.child[xDamRd].field[hTotal].value + 1
done
               
hero.child[cPfPTaDam1].field[hTotal].value = hero.child[cPfPTaDam1].field[hTotal].value + hero.child[xDamRd].field[hTotal].value + 1
done                 

hero.child[cDwDDR1].field[hTotal].value = hero.child[cDwDDR1].field[hTotal].value + hero.child[xDamRd].field[hTotal].value + 1
done

This Pre-Req script also works

Code:

Damage Reduction ability required.

@valid = pickexists[cBbnDR] + pickexists[cPfPTaDam1] + pickexists[cDwDDR1]

However it won't add +1 to the total Damage Reduction. Any ideas?

Mathias February 21st, 2009 08:22 AM

Actually, damage reduction is the xDamRd pick. All the class specials that grant damage reduction do so by bootstrapping xDamRd, then setting its field[Value].value

hTotal is charges, BTW.

First, when looking for a class special or a special like Damage Reduction that hides itself when Value = 0, try putting this in an expr-req:

hero.childfound[xDamRd].tagis[Helper.ShowSpec] <> 0

(Expr-reqs were added in v3, and they simplify the process of adding the majority of pre-reqs)

The ShowSpec is added to a class ability/special once it's visible. For example, @valid = pickexists[cBbnDR] will succeed for a 1st level Barbarian, hero.childfound[xDamRd].tagis[Helper.ShowSpec] <> 0 will succeed only once the barbarian is L7+.

Increasing damage reduction is an interesting problem, though. The majority of things that grant damage reduction don't stack with each other, to they add damage reduction with this sort of statement (from Barbarian):

hero.child[xDamRd].field[Value].value = maximum(hero.child[xDamRd].field[Value].value, bonus)

(the script already calculated the variable bonus from the barbarian level)

What you have to do if you're adding +1 DR that does stack, is get your timing right so that your bonus is added after everything else adds the base DR values, but before the xDamRD pick runs the script that modifies the name to say "Damage Reduction 1/-" - drawing the # from whatever its field[Valeu].value is at that time.

xDamRd's script runs at Final, 10000, so try putting your script at Final, 9000.

All you should need is:

hero.childfound[xDamRd].field[Value].value += 1

bodrin February 21st, 2009 03:54 PM

Works with a quirk though!
 
Thanks for the help Mgehl, the script works but it has a quirk.

This Exp-Req does indeed show an error message about damage reduction, however once the DR +1 is added by an illegal acquirement of the feat it disappears because the Damage Reduction script is fulfilled, Greater Resiliency is valid at this point but it shouldn't be.

hero.childfound[xDamRd].tagis[Helper.ShowSpec] <> 0 will succeed only once the barbarian is L7+

How do I check and stop the feat from adding the Dr +1 if the character isn't a first level barbarian or a Dwarven Defender or any other class that doesn't have a Damage Reduction Class or Innate ability!

If I still keep this script in too it produces two damage reduction error messages.

@valid = pickexists[cBbnDR] + pickexists[cPfPTaDam1] + pickexists[cDwDDR1]

Mathias 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.

bodrin February 22nd, 2009 09:38 AM

Thank you
 
Mgehl you genius, The script provided by your good self works a treat with a few modifications.

Eval script final phase 9000
Code:

hero.childfound[xDamRd].field[Value].value += 1
Exp-Req ticked is silent error Damage reduction as a class feature or innate ability Required.
Code:

hero.childfound[xDamRd].tagis[Helper.ShowSpec] <> 0
Pre-Req ticked is error Damage reduction as a class feature or innate ability Required.
Code:

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

I made the value >=0 because the Damage reduction only needs to be a class or innate ability and not be actually active with a value of say DR 1 / - when the feat is taken!
The feat adds the +1 so a first level barbarian would benefit from taking this feat straight away and benefit at 7th level and so forth!

Mathias February 22nd, 2009 02:56 PM

Reading through the feat, a 1st level barbarian doesn't fulfill the pre-req. You don't fulfill a pre-req if the ability is something your class will get eventually, you only fulfill it once your class grants the ability. I suggested leaving out the check for fulfilling the pre-req within the script because DMs are free to override that for their campaigns.

bodrin February 22nd, 2009 03:05 PM

Quote:

Originally Posted by mgehl (Post 29412)
Reading through the feat, a 1st level barbarian doesn't fulfill the pre-req. You don't fulfill a pre-req if the ability is something your class will get eventually, you only fulfill it once your class grants the ability. I suggested leaving out the check for fulfilling the pre-req within the script because DMs are free to override that for their campaigns.

This is merely semantics, Damage reduction as a "class feature" or innate ability Required, the players handbook states under "Class features" of the barbarian @ 7th level gains Damage reduction 1 / - , as you also identify this is down to the individual Dungeon masters interpretation of the Rules.

I, however think that just having the ability to gain the DR later fulfills the criteria of the feat even at first level but can understand the reasoning behind not allowing the feat until the Damage reduction is active at certain class levels!


All times are GMT -8. The time now is 01:40 PM.

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