EffectCurse

From NWN Lexicon
Jump to: navigation, search

EffectCurse(int, int, int, int, int, int)

Create a Curse effect.

effect EffectCurse(
    int nStrMod = 1,
    int nDexMod = 1,
    int nConMod = 1,
    int nIntMod = 1,
    int nWisMod = 1,
    int nChaMod = 1
);

Parameters

nStrMod

strength modifier (Default: 1)

nDexMod

dexterity modifier (Default: 1)

nConMod

constitution modifier (Default: 1)

nIntMod

intelligence modifier (Default: 1)

nWisMod

wisdom modifier (Default: 1)

nChaMod

charisma modifier (Default: 1)

Description

Returns a new effect object that when applied to a target will reduce their ability scores by the amounts given in the parameters.

A value of 0 should mean just no decrease in that ability. If all are 0, it is likely to return an invalid effect.

The target this effect is applied to must be a creature for it to work.

Remarks

Modifiers should be given in positive amounts, the script will apply them negatively.

Multiple applications of curse stacks.

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.

Known Bugs

When applied instantly, the curse effect will not be retriveable via GetFirst/NextEffect function. Therefore the curse effect won't be removable by standard means such as Remove curse spell, Greater restoration and so on. It will be however possible to remove it directly from the defined variable. See the Effect Tutorial for more details.

Version

1.62

Example

// Sample code for applying a Curse of 1 of every stat to a target
 
void main()
{
    // This is the Object to apply the effect to.
    object oTarget = OBJECT_SELF;
 
    // Create the effect to apply
    effect eCurse = EffectCurse(1, 1, 1, 1, 1, 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, eCurse, oTarget);
}

See Also


 author: John Shuell, editor: Jasperre, additional contributor(s): Jasperre