#include "inc_misc_tools"
// This script is used by the pits created by "CreatePit" function
void main()
    {
    object oPC = GetPCSpeaker();
    object oDest = GetLocalObject(OBJECT_SELF,"Dest");
    if (!GetIsObjectValid(oDest))
        {
        oDest = DetermineDestination(TRUE);
        if (!GetIsObjectValid(oDest)) // This should NEVER happen but it seems it is. Destroy the pit if the destination is invalid.
            {
            DestroyObject(OBJECT_SELF);
            return;
            }
        }
    object oRope = CreateObject(OBJECT_TYPE_PLACEABLE,"rdg_rope_used",GetLocation(oDest),TRUE);
    // LINK THE ROPE TRANSITION
    SetLocalInt(OBJECT_SELF,"Safe",TRUE);// Used in Pit conversation
    LinkTransitions(oRope,OBJECT_SELF);         //Creates the actual link.
    LinkTransitions(oDest,OBJECT_SELF);
    SetLocalObject(OBJECT_SELF,"Rope",oRope);
    if (GetIsObjectValid(GetItemPossessedBy(oPC,"misca055")))
        return;
    DestroyObject(GetItemPossessedBy(oPC,"rdg_rope"));
    }
