GetCasterAbilityModifier

From NWN Lexicon
Jump to navigationJump to search


GetCasterAbilityModifier(object)

Returns the modifier from the ability score that matters for this caster.

Parameters

oCaster

The object you want the ability score modifier for.


Description

Returns the modifier from the ability score that matters for this caster.



Remarks

This function has a very limited scope. It only tests oCaster for the wizard class. The return value is only concerned with the Charisma and Intelligence abilities.

See the example section for more details.


Requirements

#include " x0_i0_spells "


Version

???

Example

// Function source code from x0_i0_spells.
int GetCasterAbilityModifier(object oCaster)
{
    int nClass = GetLevelByClass(CLASS_TYPE_WIZARD, oCaster);
    int nAbility;
    if (nClass > 0)
    {
        nAbility = ABILITY_INTELLIGENCE;
    }
    else
        nAbility = ABILITY_CHARISMA;

    return GetAbilityModifier(nAbility, oCaster);
}

See Also

functions: 

GetAbilityModifier



author: Mistress