GetStealthMode(object)

Determines if a given creature is using a stealth mode.

int GetStealthMode(
    object oCreature
);

Parameters

oCreature

Creature to determine if it is using stealth.


Description

Returns STEALTH_MODE_ACTIVATED if oCreature is using stealth, STEALTH_MODE_DISABLED if not.



Version

1.23

Example

// Placed on the OnEnter script for a trigger
object oPC = GetEnteringObject();
if ( GetIsPC(oPC) ) {
    // Something normally happens here, but give a character
    // using stealth a chance to avoid it
    if ( GetStealthMode( oPC ) == STEALTH_MODE_ACTIVATED ) {
        int nDC = 15;    // difficulty of thing to avoid
        int nQuiet = GetSkillRank( SKILL_MOVE_SILENTLY, oPC );
        if ( (nQuiet >= 0) && (d20() + nQuiet >= nDC) ) {
            // Player was quiet
            return;
         }
    }
    // Did not sneak by - something unpleasant happens here
}

See Also

categories: Get Data from Creature Functions
constants: STEALTH_MODE_* Constants


 author: Drake Coker, editor: Charles Feduke