void main()
{
object oPC = GetLastUsedBy();
int nDamageAmount = d6(1);
effect eFallDamage = EffectDamage(nDamageAmount, DAMAGE_TYPE_BLUDGEONING);


if (GetIsPC(oPC)== TRUE)
    {
    int nDex = GetAbilityScore(oPC, ABILITY_CONSTITUTION);

    if(nDex + d20(1) >= 20)
        {
        object oDrop = GetWaypointByTag("fr_iwd_outofuriver2");

        SendMessageToPC(oPC, "You manage to swim far enough, and you are thrown by the power of the stream to the edge of the cliff.");
        AssignCommand (oPC,JumpToObject(oDrop));
        }
     else
        {

        SendMessageToPC(oPC, "You ran out of air and are forced to return.");
        BlackScreen(oPC);
        DelayCommand(2.0, FadeFromBlack(oPC, FADE_SPEED_SLOW));
        DelayCommand(2.0, PlayVoiceChat(VOICE_CHAT_PAIN3, oPC));
        DelayCommand(2.0, PlaySound("as_na_splash1"));
        DelayCommand(4.0, AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, 20.0)));
        DelayCommand(4.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eFallDamage, oPC));
        }
    }
}