Member
Join Date: Dec 2006
Posts: 62
|
I am now working on a special ability that has a bonus that increments at a different rate for each class. It is a reputation bonus.
As an example the Assassin's Reputation bonus is: levels 1 - 3 +0 levels 4 - 7 +1 levels 8 - 11 +2 and so on. I want the output for the special abilities on the Character sheet to show "Reputation Bonus" with the correct number. Is this possible? Anyone know how to do this? I am just a DM that can sort of hack his way around some very basic scripting. If this is possible I could use this type of thing for other custom abilities that are just numbers. |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Look at the Barbarian's Rage (1/day) - that shows how the number of uses per day is calculated based on level. The dwarven defender's AC Bonus +1 shows a similar bonus being used to alter the character's stats (Dodge AC in that case, but you can figure out how to apply it to whatever skills or other things the rep bonus modifies).
|
#2 |
Member
Join Date: Dec 2006
Posts: 62
|
Thank you, I'll look at those examples.
|
#3 |
Member
Join Date: Dec 2006
Posts: 62
|
After hacking through the examples you pointed me to, I came up with the following which does the job nicely.
~ Get Level var level as number level = field[xTotalLev].value ~ Reputation Bonus. var total as number total = 0 + (level / 4) total = round(total, 0, -1) field[hTotal].value += total field[livename].text = "Reputation + " & total & "" But now I am stumped on the next issue. Lets say I have a character that is multi classed. Each class has a reputation bonus progression as above and they have 4 levels in each class. How do I get the Reputation bonus to add up for each class and display properly? |
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
At 10:31 AM 11/25/2007, you wrote:
Quote:
total = (level - level % 4) / 4 The "level % 4" gives you the remainder after dividing by 4. For a value of 3, the remainder is 3. For a value of 6, the remainder is 2. Subtracting the remainder from the initial value leaves a number that is equally divisible by 4 and yields the value you want, without having to round off a fractional value. If using "round" makes more sense to you, it's fine to use it. I just figured I would throw out this suggestion in case it's clearer. |
|
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
I haven't played around with something like that, yet, but it sounds similar to the way sneak attack or turn undead are handled, since those can come from multiple classes.
Quote:
|
|
#6 |
Senior Member
Join Date: Jul 2007
Location: Syracuse, NY (USA)
Posts: 213
|
Looks like all you need to do is create a "Special" in the editor, call it Reputation. You can hit "New (Copy)" and choose Sneak Attack, then modify as you need to. Then go into each class and copy the class specials for Sneak Attack, but make them apply to Reputation instead.
You may have to experiment with the eval code to get the right results if you want the overall bonus to be based on the sum of the class levels. For example, a character with 6 levels of Assassin and 6 levels of Rogue would have 12 class levels... by your math above, this character would get a +2 instead of a +3. You can get it to calculate a +3 if you put the eval code on the initial Reputation thing rather than the class specials, then you could get rid of the class specials and just bootstrap the Reputation thing. I just don't know how that would be affected by monster class levels. |
#7 |
|
|