VersusRacialTypeEffect

From NWN Lexicon
Jump to: navigation, search

VersusRacialTypeEffect(effect, int)

Set eEffect to be versus nRacialType.

effect VersusRacialTypeEffect(
    effect eEffect,
    int nRacialType
);

Parameters

eEffect
Effect to alter
nRacialType
A race to affect, RACIAL_TYPE_* constants or a line in racialtypes.2da


Description

Returns an effect modified in such a way as to be versus a specific race of creature only. Uses the RACIAL_TYPE_* constants to define the race to use.

Only a limited set of effects can be affected by this.

Remarks

This is a pretty handy function when creating spell effects or special items to be used against (or by) a certain race of creature. Notice that it expects the RACIAL_TYPE_ constants as a parameter. If you wanted it to affect Elves only, you would set the parameter to RACIAL_TYPE_ELF. If you wanted it to affect all Giant type creatures, you set the parameter to RACIAL_TYPE_GIANT.

You must apply this before the effect is linked to others with EffectLinkEffects.

Effect Breakdown

This will have an effect on these effect types (this will be expanded as more are found). To retrieve the racial type the effect is against using GetEffectInteger or see any mechanical changes, check the given effect page for more details since the integer may be different each time. It will be set to RACIAL_TYPE_INVALID if this is not used.

Ones that this does not work on are essentially everything else, this includes several effects that Bioware themselves use this on, alas.

Version

1.22

Example

// A sword that does extra damage effect against dragons only.
 
void main(){
	effect eBonusToApply = EffectDamageIncrease(20, DAMAGE_TYPE_MAGICAL);
	eBonusToApply = VersusRacialTypeEffect(eBonusToApply, RACIAL_TYPE_DRAGON);
	object oTargetOfSpell = GetSpellTargetObject();
	ApplyEffectToObject(DURATION_TYPE_INSTANT, eBonusToApply, oTargetOfSpell);
}

See Also

functions:  VersusTrapEffect

VersusAlignmentEffect

constants: 

RACIAL_TYPE_* Constants



 author: John Shuell