VersusRacialTypeEffect

From NWN Lexicon



Contents

[edit] VersusRacialTypeEffect(effect, int)

Set eEffect to be versus nRacialType.

effect VersusRacialTypeEffect(
    effect eEffect,
    int nRacialType
);

[edit] Parameters

eEffect

nRacialType

RACIAL_TYPE_*


[edit] 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.



[edit] 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.


[edit] Version

1.22

[edit] 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);
}

[edit] See Also

functions: 

VersusTrapEffect

constants: 

RACIAL_TYPE_* Constants



 author: John Shuell
 

Personal tools
Categories