NWN2Wiki
Advertisement
// Create a Damage Increase effect
// - nBonus: DAMAGE_BONUS_*
// - nDamageType: DAMAGE_TYPE_*
// NOTE! You *must* use the DAMAGE_BONUS_* constants! Using other values may
//       result in odd behaviour.
effect EffectDamageIncrease(int nBonus, int nDamageType=DAMAGE_TYPE_MAGICAL, int nVersusRace = -1);

NWN2 also has a paramater for racial type which comes after nDamageType. By default, it is set to -1, however if you want a specific damage increase against a specific race it's the place to enter a RACIAL_TYPE constant.

Bug Notes[]

The effect is used for several abilities in the game such as Epic Divine Might and Divine Favor. It is well known that these abilities ignore immunities and will multiply on critical hits. It is not the case for all damage types. The function is also highly unpredictable if you apply more than one bonus of different damage type simultaneously. It is however, safe to apply multiple bonuses of the same damage type simultaneously.

Behavior Table[]

Damage type Multiplies on critical hits Ignores damage resistance and immunities
Bludgeoning No No
Slashing No Yes
Piercing No Yes
Cold Yes Yes
Fire Yes Yes
Acid Yes Yes
Electrical Yes Yes
Sonic Yes Yes
Negative Yes Yes
Divine Yes Yes
Magical Yes Yes
Positive Yes Yes
Divine Yes Yes

Reproducing the experiment[]

Simply use the ExecuteScript function from the client load event to fire the following script:

// For non-dice damage bonuses. This can go beyond the 40 damage limit.
// If the duration is 0.0, the effect will be permanent.
void ApplyStaticDamageBonus(
    object oTarget, 
    int nAmount, 
    int nDamageType = DAMAGE_TYPE_MAGICAL)
{
    // function takes the amount and maps to DAMAGE_BONUS_* constant
    int nConst = DamageToConstant(nAmount);
    
    effect eDam = EffectDamageIncrease(nConst, nDamageType);
    
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDam, oTarget);
    
    int nDiff = nAmount - 40;
    if(nDiff > 0)
    {
            ApplyStaticDamageBonus(oTarget, nDiff, nDamageType);
    }
}

void main()
{
    // change value to test different types.
    int nType = DAMAGE_TYPE_BLUDGEONING;
    
    // give immunity to all creatures in the area, so that your test dummies are 
    // immune.
    object oArea = GetArea(OBJECT_SELF);
    object oCreature = GetFirstObjectInArea(oArea);
    
    while(GetIsObjectValid(oCreature))
    {
        effect eImmu = EffectDamageImmunityIncrease(nType, 100);
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eImmu, oCreature);
        oCreature = GetNextObjectInArea(oArea);
    }
    
    ApplyStaticDamageBonus(OBJECT_SELF, 100, nType);
}
Advertisement