How to apply uncapped bonus to AC Dodge without nwnx

I was digging up in nwn engine code and found out very interesting bug in code that can be abused by scripters.

The bug is about engine not checking any cap or extra conditions for AC increase/decrease effects against certain race or alignment.

Example code:

effect e = ExtraordinaryEffect(VersusRacialTypeEffect(EffectACIncrease(30),RACIAL_TYPE_HUMANOID_ORC));

this code will make oPC’s AC higher by 30 points against orc race. Not only this exceeds the normal +20 cap on dodge AC it will also work no matter whether is player flatfooted or not. Basically it works as natural AC.

I tried set it vs RACIAL_TYPE_ALL but that didn’t work. However I think that all you need to to make this apply to everyone is apply such effect three times, first versus alignment good, then evil and then neutral.


If I read the code in debugger correctly then any AC bonuses against damage type, racial type or alignment will:

  • stack with non-conditional bonuses of the same type (ie. +5 armor bonus against race will stack with +5 enhancement to ac on fullplate), however except dodge they will not stack with other conditional ac bonuses of same type, higher applies
  • work no matter of condition (unlike non-conditional dodge/deflection bonuses that works only when certain conditions such as not beeing flatfooted are met)
  • work against touch attacks
  • unfortunately not raise ac value in character sheet

The random loot in Infinite Dungeons often have conditional and unconditional AC bonus together on the same item. Not sure if that is intentional or just a bug in the loot generation code.

What about attack bonuses? Could conditional and unconditional attack bonus stack in the same way too? Infinite dungeons have plenty of those weapons too!

That’s interesting information, thanks. Need to check it out in NWN2.

this doesn’t seem to apply to itemproperties those are coded differently it must be EffectACIncrease()

I tested this and armor with +5 ac and +5 vs orc gave +5 only.

Attack bonus uses different calculation,I don’t think it shares this issue.

1 Like