• 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 a circumstance bonus

You mean add a circ bonus to a skill from an eval script in a magic item?

Circumstance bonuses are one of the few bonuses which stack with themselves, so you just need to add to the ModCirc field of the skill in question.

Code:
hero.childfound[SKILLID].field[ModCirc].value += X
 
Gotcha, thanks. It's the whole stacking/not stacking issue that confuses me. When I added a competence bonus it was with this line:

Code:
#competencebonus[hero.childfound[skIntim], 2]

Is that because competence bonuses don't stack? How is that line of code different to using the maximum command?
 
#competencebonus[#pick,#bonus] is turned by the compiler into:

#pick.field[BonComp].value = maximum(#pick.field[BonComp].value, #bonus)

So, it is using maximum - just takes less typing.
 
Ok, so what would happen if I did this:

Code:
hero.childfound[SKILLID].field[BonComp].value += X

Would the += override the stacking issue?
 
Competence bonuses shouldn't stack with themselves, so what you'd get with that would depend on the order it was applied if another thing also added a competence bonus the correct way.
 
Item A applies a +3 competence bonus like so:

Code:
#competencebonus[hero.childfound[skIntim], 3]

Item B does it like this:
Code:
hero.childfound[skIntim].field[BonComp].value += 3

If the script on A runs first, then you get 3, then the script on B increases it to a total bonus of 6 (which is wrong, since they shouldn't stack).

If B runs first, you get 3, and then A results in no change (which is correct).

Long story short, when something applies a non-stacking bonus it is best to use the macro.
 
I think the fact that Competence and Enhancement bonuses got their own Macro instead of using #applybonus like everyone else is just one of those odd old quirks of the early days of HL programming. You can pretty much forget about them and just use applybonus for those types of bonuses as well.
 
Back
Top