void main() {
    // Get the player character involved in the conversation
    object oPC = GetPCSpeaker();

    // Check if the returned object is valid
    if (GetIsObjectValid(oPC)) {
        int nCost = 100000; // Cost for 1 token

        if (GetGold(oPC) >= nCost) {
            TakeGoldFromCreature(nCost, oPC, TRUE);
            CreateItemOnObject("cas_token", oPC, 99);
            CreateItemOnObject("cas_token", oPC, 1);
        } else {
            FloatingTextStringOnCreature("You do not have enough gold.", oPC, FALSE);
        }
    } else {
        // Optionally handle the error case if needed
        SendMessageToPC(oPC, "Error: Invalid object in conversation.");
    }
}
