Negative Energy Damage
Moderators: Moderator, Quality Control, Developer, DM
-
- Posts: 26
- Joined: Sat Jun 15, 2013 1:04 pm
Negative Energy Damage
When using Death Ward Spell and Shadow Shield Spell (Darkness Domain), my toon is not immune to negative energy damage. Is immune to negative energy damage if only one of those spells (Death Ward or Shadow Shield) is active. Is this a feature or bug?
-
- Posts: 1947
- Joined: Sat Jul 28, 2018 8:51 am
Re: Negative Energy Damage
Thanks for reporting. This looks like a bug and we will test it to confirm and mark it for fixing! 

- Kitunenotsume
- Posts: 631
- Joined: Sun May 17, 2020 10:57 pm
- Location: UTC -7
Re: Negative Energy Damage
For reference, regarding the cause here
The NWN2 base engine has an overflow error where values over 100% immunity are translated into negative values by subtracting 250. Thus 2 sources of 100% immunity result in a 50% vulnerability (50% extra damage taken), and any immunity items (even 5%) plus deathward (100%) will result in massive extra damage (105 - 250 = 145% vulnerability, resulting in 245% damage taken from negative energy.)
If theoretically 3 sources of energy immunity were acquired (like an Undead using Deathward and Shadow Shield), you'll have 50% immunity (half damage)
The NWN2 base engine has an overflow error where values over 100% immunity are translated into negative values by subtracting 250. Thus 2 sources of 100% immunity result in a 50% vulnerability (50% extra damage taken), and any immunity items (even 5%) plus deathward (100%) will result in massive extra damage (105 - 250 = 145% vulnerability, resulting in 245% damage taken from negative energy.)
If theoretically 3 sources of energy immunity were acquired (like an Undead using Deathward and Shadow Shield), you'll have 50% immunity (half damage)
I play a baker. Sometimes she provides counseling or treatment.
Ask about our Breadflower daily special to save five coppers off a purchase of five pastries.
She seems unusually interested in cursed items.
She has also been seeking a variety of gems and stones.
Ask about our Breadflower daily special to save five coppers off a purchase of five pastries.
She seems unusually interested in cursed items.
She has also been seeking a variety of gems and stones.
-
- Posts: 1947
- Joined: Sat Jul 28, 2018 8:51 am
Re: Negative Energy Damage
I don't believe this is correct since i did apply 250% of fire immunity to myself on local test server that replicates bgtscc environment and it worked just fine.Kitunenotsume wrote: ↑Thu Jan 06, 2022 9:32 pm For reference, regarding the cause here
The NWN2 base engine has an overflow error where values over 100% immunity are translated into negative values by subtracting 250. Thus 2 sources of 100% immunity result in a 50% vulnerability (50% extra damage taken), and any immunity items (even 5%) plus deathward (100%) will result in massive extra damage (105 - 250 = 145% vulnerability, resulting in 245% damage taken from negative energy.)
If theoretically 3 sources of energy immunity were acquired (like an Undead using Deathward and Shadow Shield), you'll have 50% immunity (half damage)
There was a granted 100% fire immunity feat + special trigger zone which grants 100% fire immunity + 50% fire immunity item.
There could be edge cases in where it overflows, but i basically had 250 immunity and it worked just correct.
- Kitunenotsume
- Posts: 631
- Joined: Sun May 17, 2020 10:57 pm
- Location: UTC -7
Re: Negative Energy Damage
I suspect there is a difference between the two forms of application: Arbitrarily Large Damage Resistance vs true percentage immunity
the Energy Immunity spells for example do not use percentage immunity, instead they grant "EffectDamageResistance(DAMAGE_TYPE_ACID, 9999, 0)"
Deathward, instead, uses "EffectDamageImmunityIncrease(DAMAGE_TYPE_NEGATIVE, 100)"
If you had both (one granting "immunity" via Damage Resistance, and the maximum -149% Damage Immunity), you would still take no damage.
in either regards, the issue here stems from EffectDamageImmunityIncrease(), which is the code in concern.
Simplest solution is to change Deathward/Shadowshield to use the same effect as the Energy Immunity spells.
the Energy Immunity spells for example do not use percentage immunity, instead they grant "EffectDamageResistance(DAMAGE_TYPE_ACID, 9999, 0)"
Deathward, instead, uses "EffectDamageImmunityIncrease(DAMAGE_TYPE_NEGATIVE, 100)"
If you had both (one granting "immunity" via Damage Resistance, and the maximum -149% Damage Immunity), you would still take no damage.
in either regards, the issue here stems from EffectDamageImmunityIncrease(), which is the code in concern.
Simplest solution is to change Deathward/Shadowshield to use the same effect as the Energy Immunity spells.
I play a baker. Sometimes she provides counseling or treatment.
Ask about our Breadflower daily special to save five coppers off a purchase of five pastries.
She seems unusually interested in cursed items.
She has also been seeking a variety of gems and stones.
Ask about our Breadflower daily special to save five coppers off a purchase of five pastries.
She seems unusually interested in cursed items.
She has also been seeking a variety of gems and stones.
-
- Posts: 1947
- Joined: Sat Jul 28, 2018 8:51 am
Re: Negative Energy Damage
I had a script that summed up all effect_damage_immunity on my PC, so i'm pretty sure they all were immunity effects, not resistance ones.Kitunenotsume wrote: ↑Fri Jan 07, 2022 11:10 pm I suspect there is a difference between the two forms of application: Arbitrarily Large Damage Resistance vs true percentage immunity
the Energy Immunity spells for example do not use percentage immunity, instead they grant "EffectDamageResistance(DAMAGE_TYPE_ACID, 9999, 0)"
Deathward, instead, uses "EffectDamageImmunityIncrease(DAMAGE_TYPE_NEGATIVE, 100)"
If you had both (one granting "immunity" via Damage Resistance, and the maximum -149% Damage Immunity), you would still take no damage.
in either regards, the issue here stems from EffectDamageImmunityIncrease(), which is the code in concern.
Simplest solution is to change Deathward/Shadowshield to use the same effect as the Energy Immunity spells.
Yeah, it feels weird that energy immunity spell grants damage resistance instead of damage immunity in first place, along with other spells which do the same.
But, in my test, it was fire immunity and it worked just fine without overflowing values. Could be that death immunity is different, since i didn't test it exactly.
- Valefort
- Retired Admin
- Posts: 9779
- Joined: Thu Apr 28, 2011 5:07 pm
- Location: France, GMT +2
Re: Negative Energy Damage
Should be fixed for next update.
Mealir Ostirel - Incorrigible swashbuckler