Aschbourne_PRC8/_module/nss/npc_sit_chair.nss

34 lines
1.0 KiB
Plaintext
Raw Permalink Normal View History

2024-06-14 10:48:20 -04:00
void main()
{
// * May 2002 (Brent): Don't do this if I am in combat or conversation
if (!GetIsInCombat() && !IsInConversation(OBJECT_SELF))
if (GetCurrentAction() != ACTION_SIT)
{
ClearAllActions();
int i = 1;
// * find first free chair
object oChair = GetNearestObjectByTag("NW_CHAIR", OBJECT_SELF,i);
int bFoundChair = FALSE;
while (bFoundChair == FALSE && GetIsObjectValid(oChair) == TRUE)
{
// * This chair is free
if (GetIsObjectValid(GetSittingCreature(oChair)) == FALSE)
{
bFoundChair = TRUE;
ActionSit(oChair);
}
else
{
i++;
oChair = GetNearestObjectByTag("NW_CHAIR", OBJECT_SELF,i);
}
}
if (bFoundChair == FALSE)
{
// SpeakString("This sucks I have no place to sit");
ClearAllActions();
ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_SCRATCH_HEAD);
}
}
}