GetStealthMode
From NWN Lexicon
Jump to navigationJump to search
GetStealthMode(object)
Determines if a given creature is using a stealth mode.
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
}
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
constants: |
author: Drake Coker, editor: Charles Feduke