void main()
{
    // Give the pc speaker the rules for blackjack item
    CreateItemOnObject("cas_themritual", GetPCSpeaker(), 1);
    
    DelayCommand(6.0, DestroyObject(OBJECT_SELF));

}

void main()
{
    // The creature running the script
    object oCreature = OBJECT_SELF;

    // Get the player character who is interacting
    object oPC = GetPCSpeaker();

    // Check if the player has enough gold
    int nGoldRequired = 7000000;
    if (GetGold(oPC) < nGoldRequired)
    {
        // Player doesn't have enough gold
        AssignCommand(oCreature, ActionSpeakString("The creature refuses to hand over the ritual due to a lack of gold."));
        return;
    }

    // Player has enough gold, remove the gold from the player
    TakeGoldFromCreature(nGoldRequired, oPC, TRUE);

    CreateItemOnObject("cas_themritual", oPC); 
    DelayCommand(6.0, DestroyObject(OBJECT_SELF));
}
