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

Old 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
Mathias is offline   #2 Reply With Quote