VersusAlignmentEffect(effect, int, int)

From NWN Lexicon
Jump to navigationJump to search

Set eEffect to be versus a specific alignment.

effect VersusAlignmentEffect(
    effect eEffect,
    nLawChaos=ALIGNMENT_ALL,
    nGoodEvil=ALIGNMENT_ALL
);

Parameters

eEffect
Effect to alter
nLawChaos
ALIGNMENT_LAWFUL/ALIGNMENT_CHAOTIC/ALIGNMENT_ALL (Default: ALIGNMENT_ALL)
nGoodEvil
ALIGNMENT_GOOD/ALIGNMENT_EVIL/ALIGNMENT_ALL (Default: ALIGNMENT_ALL)

Description

Returns an effect modified in such a way as to be versus a specific alignment only. Uses the ALIGNMENT_ constants to define which scales to use.

Remarks

This is a pretty handy function when creating spell effects or special items to be used against (or by) a certain alignment or group of alignments. Notice that it expects two ALIGNMENT_ constants as parameters. If you wanted it to affect Chaotic Evil alignments only, you would set the first alignment parameter to ALIGNMENT_CHAOTIC and the second parameter to ALIGNMENT_EVIL. If you wanted it to affect all GOOD aligned creatures, you set the first parameter to ALIGNMENT_ALL (since it does not matter if they are chaotic or lawful for this effect) and the second parameter to ALIGNMENT_GOOD.

This should be used before an effect is linked with EffectLinkEffects.

Effect Breakdown

This will have an effect on these effect types (this will be expanded as more are found). To retrieve the alignment the effect is against using GetEffectInteger or see any mechanical changes, check the given effect page for more details:

Ones that this does not work on are essentially everything else, this includes several effects that Bioware themselves use this on, such as EffectSpellResistanceIncrease and EffectDamageShield which are used in Aura versus Alignment, for instance.

Version

1.22

Example

// Give the target of the spell an armor class increase of 1 by
// boosting his Dodge ability against all types of attacks only if
// the target is Chaotic Evil in alignment

void main(){
    effect eBonusToApply = EffectACIncrease(1, AC_DODGE_BONUS, AC_VS_DAMAGE_TYPE_ALL);
    eBonusToApply = VersusAlignmentEffect(eBonusToApply, ALIGNMENT_CHAOTIC, ALIGNMENT_EVIL);
    object oTargetOfSpell = GetSpellTargetObject();
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonusToApply, oTargetOfSpell, 60.0);
}

See Also

functions:  VersusTrapEffect

VersusRacialTypeEffect

constants: 

ALIGNMENT_* Constants


 author: John Shuell, editor: Jeremy Spilinek