Initial Commit
Initial Commit
This commit is contained in:
37
_module/nss/bjdlrattacked.nss
Normal file
37
_module/nss/bjdlrattacked.nss
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* 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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user