#include "cas_casinoinc"

void main() 
{
    // Get the player character involved in the conversation
    object oPC = GetPCSpeaker();
    EnsureTokenPouch(oPC);
    // Check if the returned object is valid
    if (GetIsObjectValid(oPC)) 
    {
        // Find the item with the tag "I_CAS_HANDLE"
        object oHandle = GetItemPossessedBy(oPC, "I_CAS_CASINOHANDLE");
        if (GetIsObjectValid(oHandle))
        {
            // Set the nBETAMOUNT variable to 25
            SetLocalInt(oHandle, "nBET_AMOUNT", 25);
            SendMessageToPC(oPC, "Number of tokens to bet set to 25.");
        } 
        else 
        {
            // Item not found, return an error message
            SendMessageToPC(oPC, "Error: I_CAS_HANDLE item not found.");
        }
    } 
    else 
    {
        // Optionally handle the error case if needed
        SendMessageToPC(oPC, "Error: Invalid object in conversation.");
    }
}
