41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
#include "x4_inc_functions"
|
|
int StartingConditional()
|
|
{
|
|
object oStool1 = GetNearestObjectByTag("mpoker_stool1");
|
|
object oStool2 = GetNearestObjectByTag("mpoker_stool2");
|
|
|
|
object oP1 = GetSittingCreature(oStool1);
|
|
object oP2 = GetSittingCreature(oStool2);
|
|
|
|
SetLocalObject(OBJECT_SELF, "oP1", oP1);
|
|
SetLocalObject(OBJECT_SELF, "oP2", oP2);
|
|
|
|
if (GetLocalInt(OBJECT_SELF, "STAGE") == 1)
|
|
{
|
|
//Retrieve proposed stakes
|
|
string sMessage = GetLocalString(OBJECT_SELF, "SPOKEN");
|
|
int nLength = GetStringLength(sMessage);
|
|
//Let's get rid of the "#"
|
|
sMessage = GetStringRight(sMessage, nLength-1);
|
|
int nBet = StringToInt(sMessage);
|
|
SetLocalInt(OBJECT_SELF, "BET", nBet);
|
|
|
|
//Set the other PC as current player
|
|
string sCurrent = GetLocalString(OBJECT_SELF, "CURRENT");
|
|
if (sCurrent == "oP1") sCurrent = "oP2";
|
|
else sCurrent = "oP1";
|
|
SetLocalString(OBJECT_SELF, "CURRENT", sCurrent);
|
|
object oPlayer = GetLocalObject(OBJECT_SELF, sCurrent);
|
|
|
|
//Set token
|
|
SetCustomToken(916, GetName(oPlayer));
|
|
|
|
//Prepare the next stage
|
|
SetLocalInt(OBJECT_SELF, "STAGE", 2);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
return FALSE;
|
|
}
|