From NWN Lexicon
Revision as of 06:58, 24 June 2019 by Shadguy (talk | contribs) (Spelling fix(es))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


Gets a creature's arcane spell failure factor

int GetArcaneSpellFailure(
    object oCreature



Creature to get arcane spell failure of


Returns the current arcane spell failure factor of a creature. It has nothing to do with EffectSpellFailure(), however.

This is merely the amount of ARMOR penalty, which can range from 0, in increments of 5, up to 95 (there seems no way to get 100, luckily for casters!). It is useful to stop henchmen casting arcane spells if they have too much armor on - and is in the default Bioware AI.


Armor and shields increase the arcane spell failure factor of a creature (PC or NPC). 95 is Tower Shield and Full Plate Armor, while 0 is clothing, or even nothing.

Function returns 0 on error, for instance if oCreature is not a valid creature.

There is no way to artificially increase this value - it is very much internal with armor, shields and 2da values.




// If the PC speaker has 80% or more caster failure, and
// has 5 levels of mage, we speak a special string
void main()
    // Get PC
    object oPC = GetPCSpeaker();
    if(GetArcaneSpellFailure(oPC) >= 80 &&
       GetLevelByClass(CLASS_TYPE_WIZARD, oPC) >= 5)
        // Speakstring
        SpeakString("You sure you should be wearing armor, mage?");

See Also

 author: Lilac Soul, editor: Jasperre