#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_HANDLE");
        if (GetIsObjectValid(oHandle)) {
            // Set the nBETAMOUNT variable to 25
            SetLocalInt(oHandle, "nBET_AMOUNT", 50);
            SendMessageToPC(oPC, "Number of tokens to bet set to 50.");
        } 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.");
    }
}
