34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|