38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
|
/**
|
||
|
* This script is called when the dealer is attacked, it will boot all players
|
||
|
* and they all forfeit their bets. This isn't ideal, but once the dealer
|
||
|
* is attacked this messes up the conversation logic and since the conversation
|
||
|
* runs some events it can cause some serious hangs.
|
||
|
*
|
||
|
* Copyright (C) 2002-2003 Jim Woodgate - woody@realtime.net
|
||
|
*/
|
||
|
|
||
|
void BootPlayer(object oPlayer);
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
SpeakString("Ack, I've been attacked by "+GetName(GetLastAttacker())+"!");
|
||
|
|
||
|
int index = 1;
|
||
|
// check all chairs if someone is sitting there
|
||
|
// make them stand up
|
||
|
object oChair = GetObjectByTag(GetTag(OBJECT_SELF)+IntToString(index));
|
||
|
while (oChair != OBJECT_INVALID) {
|
||
|
object oPlayer = GetSittingCreature(oChair);
|
||
|
if (oPlayer != OBJECT_INVALID) { // We have someoneone!
|
||
|
BootPlayer(oPlayer);
|
||
|
}
|
||
|
index++;
|
||
|
oChair = GetObjectByTag(GetTag(OBJECT_SELF)+IntToString(index));
|
||
|
}
|
||
|
|
||
|
// Set that I'm not playing anymore
|
||
|
SetLocalInt(OBJECT_SELF, "BJPLAYING", FALSE);
|
||
|
}
|
||
|
|
||
|
void BootPlayer(object oPlayer) {
|
||
|
SetCommandable(TRUE, oPlayer);
|
||
|
AssignCommand(oPlayer, ClearAllActions());
|
||
|
}
|
||
|
|