EffectAbilityDecrease

From NWN Lexicon
Revision as of 03:50, 15 October 2013 by Shadooow (talk | contribs) (amount not limited!)
Jump to: navigation, search

EffectAbilityDecrease(int, int)

Creates an ability decreasing effect on specified ability score.

effect EffectAbilityDecrease(
    int nAbility,
    int nModifyBy
);

Parameters

nAbility

ABILITY_*

nModifyBy

This is the amount by which to decrement the ability score.

Description

Removes specified amount nModifyBy from nAbility score on an object. nModifyBy must be a positive number if a negative number is passed, nothing occurs.

The target this effect is applied to must be a creature for it to work. This effect cannot be applied instantly, only temporarily or permanently.

Remarks

There doesn't seem to be any limit of the amount of ability decrease, other than minimum ability score of creature which is 3.

Unlike other effects, when struck by ability decrease immunity, other effects in link will be applied.

Effect functions are Constructors, which are special methods that help construct effect "objects". You can declare and link effects, and apply them using an ApplyEffectToObject() Command. Once applied, each effect can be got seperately via. looping valid effects on the target (GetFirst/NextEffect()). See the Effect Tutorial for more details.

Version

1.62

Example

// Sample code for applying 1 strength damage to a target
 
void main()
{
    // This is the Object to apply the effect to.
    object oTarget = OBJECT_SELF;
 
    // Create the effect to apply
    effect eDrain = EffectAbilityDecrease(ABILITY_STRENGTH, 1);
 
    // Create the visual portion of the effect. This is instantly
    // applied and not persistant with wether or not we have the
    // above effect.
    effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
 
    // Apply the visual effect to the target
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
    // Apply the effect to the object   
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrain, oTarget);
}

See Also

functions: 

EffectAttackIncrease

constants: 

ABILITY_* Constants


 author: Jody Fletcher, editor: Jasperre, additional contributor(s): Matthew Miller, Jeremy Hinkle, LeegleechN, Charles Feduke, Jasperre