Lankhmar_PRC8/_module/nss/hb_wlbgrd_sleep.nss

30 lines
987 B
Plaintext
Raw Permalink Normal View History

2025-04-03 12:54:47 -04:00
void main()
{
object oActor;
// If running the lowest AI, abort for performance reasons.
if ( GetAILevel() == AI_LEVEL_VERY_LOW )
return;
// If busy with combat or conversation, skip this heartbeat.
if ( IsInConversation(OBJECT_SELF) || GetIsInCombat() )
return;
// Get the PC who will be referenced in this event.
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1,
CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
// Only fire if a PC is seen.
if ( OBJECT_INVALID == oPC )
return;
// Have "rgwlb1" perform a sequence of actions.
oActor = GetObjectByTag("rgwlb1");
AssignCommand(oActor, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0, 60.0));
// Have "rgwlb2" perform a sequence of actions.
oActor = GetObjectByTag("rgwlb2");
AssignCommand(oActor, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0, 60.0));
}