GetIsResting
From NWN Lexicon
Contents |
[edit] GetIsResting(object)
Check whether a creature is resting.
int GetIsResting( object oCreature = OBJECT_SELF );
[edit] Parameters
oCreature
Creature to be checked. (Default: OBJECT_SELF)
[edit] Description
Returns TRUE if oCreature is currently resting. Otherwise, returns FALSE.
[edit] Remarks
Note that applying effects such as EffectSleep() or animations such as ANIMATION_LOOPING_SIT_CROSS do not count. Only if a PC has selected his or her "rest" function, or if an NPC has been given the ActionRest() script command will this function return TRUE.
[edit] Known Bugs
Prior to 1.28, this function always returned FALSE if called outside of the event OnPlayerRest.
[edit] Version
1.28
[edit] Example
// Creature On Percieve script - if we see a PC who is sleeping, we // will go "bonk some 'eads!" void main() { // Get creature percieved object oSeen = GetLastPerceived(); // Get is can see it, or rather, we can now see it. Must also be a PC. if(GetLastPerceptionSeen() && GetIsPC(oSeen)) { // Lets go bonk thier head if they are resting if(GetIsResting(oSeen)) { SpeakString("'ere, you need bonking on der 'ead!"); ClearAllActions(); ActionAttack(oSeen); } } }
[edit] See Also
functions: |
author: Jason Harris, editor: Jasperre