(version 2)
(include "sci.sh")
(exports
    0 rm630
)
(use "Main")
(use "GloryWindow")
(use "TellerIcon")
(use "n026")
(use "OccasionalCycle")
(use "GloryControls")
(use "JumpX")
(use "IconI")
(use "CueObj")
(use "n958")
(use "DPath")
(use "Rev")
(use "GameControls")
(use "SysWindow")
(use "Sound")
(use "Cycle")
(use "Game")
(use "User")
(use "View")
(use "Obj")
(script 630)


(local
    local0
    local1[5]
    local6[5]
    local11
    local12 =     1
    local13 =     1
    local14
    local15
    local16
    local17[2]
    local19 =     7
    local20 =     160
    local21 =     3
    local22 =     1
    local23
    local24 =     -4
    local25
    local26 =     10
    local27 =     12
    local28
    local29[5] = (0 20 21 24 999 )
    local34[3]
    local37[6] = (0 -2 15 1 16 999 )
    local43[4] = (0 17 6 999 )
    local47[6]
    local53[3] = (0 -2 999 )

)
(procedure (localproc_07dd)
    (bridgeControls:disable(iconJump iconDrop iconL iconR))
    (iconJump:show())
    (iconDrop:show())
    (iconL:show())
    (iconR:show())
)


(procedure (localproc_081c)
    (bridgeControls:enable(iconJump iconDrop 
        (if (== gGClientModNum 640)
            iconR
        )(else
            iconL
        )
))
    (iconJump:show())
    (iconDrop:show())
    (iconR:show())
    (iconL:show())
)


(procedure (localproc_0864)
    (var temp0)
    = temp0 0
    (if (> Random(1 11) local26)
        (if (== gGClientModNum 640)
            (if (> (send gOwner:x) 215)
                = local26 local27
                = temp0 1
            )
        )(else
            (if (< (send gOwner:x) 258)
                = local26 local27
                = temp0 1
            )
        )
    )(else
        --local26
    )
    return temp0
)


(procedure (localproc_2563)
    (var theGCursorNumber)
    = theGCursorNumber gCursorNumber
    Message(0 630 2 6 3 2 @local1)
    Message(0 630 2 6 3 3 @local6)
    (quest:
        init()
        show()
        dispose()
    )
    (send gGame:setCursor(theGCursorNumber))
    return local0
)


(class JumpOver of JumpX
    (properties
        client 0
        caller 0
        x 0
        y 0
        dx 0
        dy 0
        {b-moveCnt} 0
        {b-i1} 0
        {b-i2} 0
        {b-di} 0
        {b-xAxis} 0
        {b-incr} 0
        completed 0
        xLast 0
        yLast 0
        desX 0
        desY 0
        xInc 0
        yInc 0
        zStep 0
        level 0
        velocity 0
        gravity 10
        height 0
        peak 0
    )

    (method (chkTarget)
        (leopard:setPri(15))
    )

)
(class Attack of JumpOver
    (properties
        client 0
        caller 0
        x 0
        y 0
        dx 0
        dy 0
        {b-moveCnt} 0
        {b-i1} 0
        {b-i2} 0
        {b-di} 0
        {b-xAxis} 0
        {b-incr} 0
        completed 0
        xLast 0
        yLast 0
        desX 0
        desY 0
        xInc 0
        yInc 0
        zStep 0
        level 0
        velocity 0
        gravity 10
        height 0
        peak 0
    )

    (method (chkTarget)
        (var temp0)
        = temp0 0
        (super:chkTarget())
        (if (== (send gOwner:view) 29)
            (if (< (send gOwner:cel) 3)
                = temp0 1
            )(else
                return 
            )
        )(else
            (if (== (send gOwner:view) 30)
                (if ((< (send gOwner:cel) 1) or (> (send gOwner:cel) 5))
                    = temp0 1
                )(else
                    return 
                )
            )(else
                = temp0 1
            )
        )
        (if (temp0)
            (leopardAttack:register(1))
            (send gOwner:setScript(0))
            (send global2:setScript(egoFell 0 0))
        )
    )

)
(class DDCPath of DPath
    (properties
        client 0
        caller 0
        x 0
        y 0
        dx 0
        dy 0
        {b-moveCnt} 0
        {b-i1} 0
        {b-i2} 0
        {b-di} 0
        {b-xAxis} 0
        {b-incr} 0
        completed 0
        xLast 0
        yLast 0
        points 0
        value 0
        cDir 1
        nPoints 0
        comp 0
    )

    (method (init param1)
        (if (not nPoints)
            (self:nPoints((- paramTotal 2)))
        )
        (super:init(rest param1))
    )


    (method (moveDone)
        (if ((self:comp))
            (self:comp(0))
            (if ((self:cDir(Random(0 1))))
                (self:value(0))
            )(else
                (self:value((self:nPoints)))
            )
        )(else
            (if (== (self:value) -1)
                (if ((self:cDir(Random(0 1))))
                    (self:value(0))
                )(else
                    (self:value((self:nPoints)))
                )
                (self:init())
            )(else
                (if (== (send points:at(value)) -32768)
                    (self:value(0))
                    (self:comp(1))
                    (self:init())
                )(else
                    (self:init())
                )
            )
        )
    )


    (method (setTarget)
        (if ((self:cDir))
            = x (send points:at(value))
            = y (send points:at(++value))
            ++value
        )(else
            = y (send points:at(value))
            = x (send points:at(--value))
            --value
        )
    )

)
(class Backward of Rev
    (properties
        client 0
        caller 0
        cycleDir -1
        cycleCnt 0
        completed 0
    )

    (method (doit)
        (if (not (send client:isStopped()))
            (super:doit())
        )
    )

)
(class xDPath of DDCPath
    (properties
        client 0
        caller 0
        x 0
        y 0
        dx 0
        dy 0
        {b-moveCnt} 0
        {b-i1} 0
        {b-i2} 0
        {b-di} 0
        {b-xAxis} 0
        {b-incr} 0
        completed 0
        xLast 0
        yLast 0
        points 0
        value 0
        cDir 1
        nPoints 0
        comp 0
    )

    (method (setTarget)
        (var theX, theY, temp2[30])
        = theX x
        = theY y
        (super:setTarget())
        (send client:loop(4))
        (switch (GetAngle(theX theY x y))
            (case 46
                (send client:cel(0))
            )
            (case 65
                (send client:cel(3))
            )
            (case 112
                (send client:cel(2))
            )
            (case 134
                (send client:cel(0))
            )
            (case 226
                (send client:cel(2))
            )
            (case 245
                (send client:cel(1))
            )
            (case 292
                (send client:cel(1))
            )
            (case 314
                (send client:cel(3))
            )
        )
        Wait(0)
        Wait(5)
        Animate((send gGQg3KDHandler:elements) 0)
        Wait(5)
    )

)
(instance public rm630 of Rm
    (properties
        noun 4
        picture 630
        vanishingY -420
    )

    (method (init param1)
        proc0_2()
        proc958_0(128 8 2 11 632 29 30)
        (send (ScriptID(36 0)):
            x(5)
            y(2)
            textX(20)
            textY(150)
        )
        = local34[0] @local29
        = local47[0] @local37
        = local47[1] @local43
        (leopard:
            init()
            setScale(170)
        )
        (skull:init())
        (doorway:init())
        (treehouse:init())
        (tree:init())
        (send gLongSong:
            number(630)
            setLoop(-1)
            play(127)
        )
        (if (== gGClientModNum 640)
            (send gOwner:
                x(121)
                y(89)
                z(30)
                setScale(420)
                origStep(16386)
                init()
                get(6)
                changeGait(2 0)
            )
            (leopardLady:
                setScale(420)
                init()
            )
            (rope:
                cel(3)
                cycleSpeed(3)
                init()
            )
            (super:init(rest param1))
            = local22 0
            = local24 4
            (leopard:show())
            (self:setScript(backFence))
        )(else
            (send gOwner:
                view(4)
                loop(3)
                cel(4)
                x(301)
                y(101)
                z(30)
                noun(5)
                setPri(2)
                setScale(420)
                init()
                hide()
            )
            (leopardLady:
                setScale(420)
                init()
                hide()
            )
            (theHut:init())
            (egoTell:init(gOwner @local29 @local34))
            (johariTell:init(leopardLady @local37 @local47 @local53))
            (send gQg3Walkers:addToFront(self))
            (super:init(rest param1))
            proc0_5(66)
            (self:setScript(enterFence))
        )
        (send gGame:save(1))
        proc0_2()
    )


    (method (doit)
        (super:doit())
        (if ((((<> gGClientModNum 640) and (> (send gOwner:x) 280)) and (send gOwner:mover)) and not script)
            (if (local16)
                proc0_2()
                (self:setScript(getCross))
            )(else
                (self:setScript(promptUser))
            )
        )
    )


    (method (dispose)
        (send gOwner:z(0))
        (send gQg3Walkers:delete(self))
        UnLoad(128 8)
        UnLoad(128 2)
        UnLoad(128 11)
        UnLoad(128 632)
        UnLoad(128 29)
        UnLoad(128 30)
        proc958_0(0 36 964 57)
        (super:dispose())
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 3
                (if (local16)
                    proc0_2()
                    (self:setScript(getCross))
                )(else
                    (self:setScript(promptUser))
                )
            )
            (case 80
                proc0_4(66)
                (super:doVerb(80))
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance promptUser of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = register 0
                (if (localproc_2563())
                    = register 1
                    (send gQg3Messager:say(1 6 14))
                )
                (send gOwner:
                    x(302)
                    setMotion(0)
                )
                = cycles 5
            )
            (case 1
                (if (register)
                    (send global2:newRoom(170))
                )(else
                    (self:dispose())
                )
            )
        )
    )

)
(instance throwFood of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:
                    view(9)
                    y(- (send gOwner:y) 3)
                    setLoop(1)
                    setCycle(End self)
                )
            )
            (case 1
                (send gOwner:
                    y(+ (send gOwner:y) 3)
                    normalize()
                    z(30)
                )
                = cycles 5
            )
            (case 2
                (send gQg3Messager:say(2 6 8 0 self))
            )
            (case 3
                (leopard:
                    moveSpeed(3)
                    cycleSpeed(3)
                    setMotion(MoveTo 197 142 self)
                )
            )
            (case 4
                (leopard:view(632))
                (if (== (leopard:loop) 3)
                    (leopard:setLoop(3))
                )(else
                    (leopard:setLoop(2))
                )
                (leopard:
                    cycleSpeed(10)
                    setCycle(OccasionalCycle self 1 10 60)
                    setMotion(0)
                )
                = cycles 1
            )
            (case 5
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance ropeThrow of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:
                    view(8)
                    x(305)
                    y(99)
                    drop(6)
                    setLoop(1)
                    setCel(0)
                    setCycle(CT 5 1 self)
                )
            )
            (case 1
                (send gOwner:setCycle(CT 6 1))
                (rope:
                    init()
                    cycleSpeed(3)
                    setCycle(End self)
                )
            )
            (case 2
                (rope:stopUpd())
                (send gOwner:
                    view(0)
                    x(305)
                    y(103)
                    z(30)
                    setScale()
                )
                = local16 1
                (if (proc0_6(66))
                    (send global2:setScript(getCross))
                )(else
                    (self:setScript(leopardApproach self))
                )
            )
            (case 3
                (leopard:
                    view(632)
                    cycleSpeed(6)
                    setLoop(1)
                    setPri(1)
                    setCycle(End self)
                )
            )
            (case 4
                (leopard:
                    view(632)
                    setLoop(0)
                    y(116)
                    moveSpeed(4)
                    cycleSpeed(4)
                    setCycle(JumpCycler 3 6)
                    setMotion(JumpOver 265 140 50 self)
                )
            )
            (case 5
                proc0_3()
                (leopard:
                    view(631)
                    y(156)
                    moveSpeed(6)
                    cycleSpeed(6)
                    setLoop(-1)
                    setPri(-1)
                    setCycle(Walk)
                    setMotion(xDPath 259 182 281 161 240 121 179 149)
                )
                (self:dispose())
            )
        )
    )

)
(instance getCross of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gOwner:
                    view(12)
                    x(295)
                    setPri(15)
                    origStep(257)
                    setLoop(1)
                    setCel(0)
                    setCycle(Walk)
                    setMotion(MoveTo + (send gOwner:x) local24 (send gOwner:y) self)
                )
            )
            (case 1
                (if ((== global209 1) and proc0_6(66))
                    (if (== (send gOwner:trySkill(2 175)) -1)
                        = local21 2
                        proc958_0(128 2 11)
                        (leopard:setScript(leopardApproach 0 1))
                        (send global2:setScript(unbalance 0 0))
                    )(else
                        (send global2:setScript(ropeCrossing 0 1))
                    )
                )(else
                    (if ((== global209 2) or (== global209 3))
                        (send global2:setScript(mediumCross))
                    )(else
                        proc958_0(128 2 11 6)
                        (leopard:setScript(leopardApproach 0 1))
                        (send global2:setScript(unbalance 0 1))
                    )
                )
                (self:dispose())
            )
        )
    )

)
(instance mediumCross of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (if (== global209 3)
                    = local20 180
                )
                (if (== gGClientModNum 640)
                    (send gOwner:code(backCheck))
                )(else
                    (if (== (send gOwner:trySkill(2 175)) -1)
                        (send gOwner:code(stepCheck))
                    )(else
                        (send gOwner:code(crossCheck))
                    )
                )
                (if (not proc0_6(66))
                    (self:setScript(leopardApproach self 0))
                )(else
                    = cycles 1
                )
            )
            (case 1
                (bridgeControls:
                    init()
                    show()
                    dispose()
                )
            )
            (case 2
                (self:dispose())
            )
        )
    )

)
(instance ropeCrossing of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (if (register)
                    (send gOwner:setMotion(MoveTo 150 103 self))
                )(else
                    (send gOwner:code(0))
                    = cycles 1
                )
            )
            (case 1
                (send gOwner:
                    view(2)
                    setLoop(-1)
                    setPri(-1)
                    yStep(1)
                    xStep(2)
                    setCycle(Walk)
                    setMotion(DPath 121 98 121 97 self)
                )
            )
            (case 2
                (send gQg3Messager:say(1 6 7 0 self))
            )
            (case 3
                (send global2:newRoom(640))
            )
        )
    )

)
(instance leopardApproach of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (leopard:
                    view(631)
                    cycleSpeed(2)
                    moveSpeed(2)
                    setCycle(Walk)
                    setLoop(-1)
                )
                (if (== gGClientModNum 640)
                    (if (> (leopardAttack:state) 0)
                        (leopard:setMotion(MoveTo 200 100 self))
                    )(else
                        (leopard:setMotion(MoveTo 175 103 self))
                    )
                )(else
                    (if (> (leopardAttack:state) 0)
                        (leopard:setMotion(MoveTo 220 132 self))
                    )(else
                        (leopard:setMotion(MoveTo 225 132 self))
                    )
                )
            )
            (case 1
                (leopard:setLoop(0))
                (unbalance:cue())
                = cycles 3
            )
            (case 2
                (if (local28)
                    localproc_081c()
                )
                (if (register)
                    (send client:setScript(leopardStart))
                )
                (self:dispose())
            )
        )
    )

)
(instance leopardStart of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (leopard:
                    view(632)
                    setLoop(1)
                    setCycle(CT 3 1 self)
                )
            )
            (case 1
                0
            )
            (case 2
                (leopard:setCycle(CT 5 1 self))
            )
            (case 3
                (leopard:
                    y(116)
                    setLoop(0)
                    cycleSpeed(4)
                    moveSpeed(4)
                    setCycle(JumpCycler 3 6)
                    setMotion(JumpOver 265 140 60 self)
                )
            )
            (case 4
                (send client:setScript(getEgo))
            )
        )
    )

)
(instance getEgo of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (leopard:
                    view(631)
                    cel(0)
                    y(+ (leopard:y) 6)
                    setLoop(6)
                    setCycle(CT 1 1 self)
                )
            )
            (case 1
                (leopard:
                    setCycle(Walk)
                    setLoop(1)
                    setMotion(MoveTo + (send gOwner:x) 5 152 self)
                )
            )
            (case 2
                (send ((send global2:script)):cue())
                (self:dispose())
            )
        )
    )

)
(instance unbalance of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gOwner:setMotion(MoveTo (- (send gOwner:x) 30) (send gOwner:y) self))
            )
            (case 1
                0
            )
            (case 2
                (if ((leopard:script))
                    (leopardStart:cue())
                )
                (send gOwner:setMotion(MoveTo (- (send gOwner:x) 5) (send gOwner:y) self))
            )
            (case 3
                (send gOwner:
                    view(11)
                    setLoop(3)
                    setCycle(End self)
                    setMotion(MoveTo - (send gOwner:x) 3 - (send gOwner:y) 2)
                )
            )
            (case 4
                (send global2:setScript(egoFell 0 0))
            )
        )
    )

)
(instance egoFell of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (if ((== global209 3) or (== global209 2))
                    (bridgeControls:state((& (bridgeControls:state) $ffdf)))
                )
                (send gOwner:
                    code(0)
                    view(6)
                    loop(local22)
                    cel(0)
                    setPri(-1)
                    moveSpeed(5)
                    setCycle(0)
                    setMotion(JumpX -55 self)
                )
            )
            (case 1
                (send gOwner:setCycle(End self))
                (sFx:
                    number(920)
                    play(127)
                )
                ShakeScreen(1)
            )
            (case 2
                proc0_2()
                (if (register)
                    (self:cue())
                )
            )
            (case 3
                (switch (local21)
                    (case 0
                        proc26_0(9 630 633 End)
                    )
                    (case 1
                        proc26_0(10 630 633 End)
                    )
                    (case 2
                        proc26_0(11 630 633 End)
                    )
                    (default 
                        proc26_0(6 630 633 End)
                    )
                )
            )
        )
    )

)
(instance enterFence of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = cycles 5
            )
            (case 1
                (send gQg3Messager:say(1 6 1 0 self))
            )
            (case 2
                (send gOwner:show())
                (leopard:show())
                (leopardLady:show())
                = cycles 2
            )
            (case 3
                (leopard:setMotion(xDPath 259 182 281 161 240 121 179 149))
                (send gQg3Messager:say(1 6 2 0 self))
            )
            (case 4
                (send gOwner:
                    setPri(-1)
                    setCycle(Beg self)
                )
            )
            (case 5
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance backFence of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gOwner:setMotion(MoveTo (send gOwner:x) (+ (send gOwner:y) 6) self))
                (leopard:setMotion(xDPath 259 182 281 161 240 121 179 149))
            )
            (case 1
                (send gQg3Messager:say(1 6 4 0 self))
            )
            (case 2
                proc0_2()
                (send gOwner:setMotion(DPath 119 99 154 101 self))
            )
            (case 3
                (send gOwner:
                    view(12)
                    y(103)
                    setCycle(Walk)
                    setMotion(MoveTo + (send gOwner:x) 15 103 self)
                )
            )
            (case 4
                (if ((== global209 2) or (== global209 3))
                    (send gOwner:
                        view(12)
                        setLoop(0)
                        setMotion(MoveTo - (send gOwner:x) 3 (send gOwner:y))
                    )
                    (send client:setScript(mediumCross))
                )(else
                    (self:cue())
                )
            )
            (case 5
                (send gOwner:
                    origStep(257)
                    setMotion(MoveTo 303 103 self)
                )
            )
            (case 6
                (send global2:setScript(egoDown self))
            )
        )
    )

)
(instance egoDown of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (moveStraight:dispose())
                (send gOwner:
                    view(4)
                    setLoop(3)
                    setCel(0)
                    code(0)
                )
                = cycles 5
            )
            (case 1
                (send gOwner:
                    cycleSpeed(10)
                    setCycle(End self)
                )
            )
            (case 2
                (rope:setCycle(CT 0 -1 self))
            )
            (case 3
                (rope:dispose())
                = cycles 5
            )
            (case 4
                (if ((send gOwner:has(46)))
                    (send global2:setScript(trans))
                )(else
                    (self:cue())
                )
            )
            (case 5
                (send gGQg3KDHandler:eachElementDo(102))
                (send global2:drawPic(0))
                = cycles 5
            )
            (case 6
                = seconds 1
            )
            (case 7
                (send gQg3Messager:say(2 6 5 0 self))
            )
            (case 8
                (send global2:newRoom(420))
            )
        )
    )

)
(instance trans of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGQg3KDHandler:eachElementDo(102))
                (send global2:drawPic(0))
                = cycles 5
            )
            (case 1
                = seconds 1
            )
            (case 2
                (send gQg3Messager:say(2 6 26 0 self))
            )
            (case 3
                ++global122
                = global120 3000
                (send global2:newRoom(620))
            )
        )
    )

)
(instance moveForward of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                localproc_07dd()
                (send gOwner:setMotion(MoveTo (+ (send gOwner:x) local24) (send gOwner:y) self))
            )
            (case 1
                = local19 (+ local19 6)
                (if (not (leopard:script))
                    (if (< local25 2)
                        (if (localproc_0864())
                            ++local25
                            localproc_081c()
                            (leopard:setScript(leopardAttack))
                        )(else
                            (if (not register and (< (send gOwner:x) 258))
                                (leopard:setScript(leopardChase))
                            )
                        )
                    )(else
                        (if (not local14)
                            (leopard:
                                moveSpeed(6)
                                cycleSpeed(6)
                                setCycle(Walk)
                                setMotion(MoveTo 259 182 leopard)
                            )
                            = local14 1
                        )
                    )
                )
                = cycles 1
            )
            (case 2
                localproc_081c()
                (self:dispose())
            )
        )
    )

)
(instance leopardChase of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (if (== gGClientModNum 640)
                    (leopard:
                        setCycle(Walk)
                        setMotion(MoveTo + (leopard:x) 3 + (leopard:y) 2 self)
                    )
                )(else
                    (leopard:
                        setCycle(Backward)
                        setMotion(MoveTo - (leopard:x) 3 - (leopard:y) 2 self)
                    )
                )
            )
            (case 1
                (leopard:setCycle(0))
                (self:dispose())
            )
        )
    )

)
(instance moveStraight of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                localproc_07dd()
                (send gOwner:setMotion(MoveTo (+ (send gOwner:x) local24) (send gOwner:y) self))
            )
            (case 1
                localproc_081c()
                (self:dispose())
            )
        )
    )

)
(instance leopardAttack of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (leopard:
                    view(632)
                    setLoop(1)
                    setCycle(End self)
                )
                (sFx:
                    number(909)
                    play()
                )
            )
            (case 1
                = local12 0
                (if (== global209 2)
                    = seconds 2
                )(else
                    (self:cue())
                )
            )
            (case 2
                = local12 1
                = seconds 0
                (leopard:
                    y(- (leopard:y) 6)
                    setLoop(0)
                    cycleSpeed(4)
                    moveSpeed(4)
                    setCycle(JumpCycler 3 6)
                    setMotion(Attack + (send gOwner:x) 13 142 68 self)
                )
            )
            (case 3
                (if (register)
                    (send client:setScript(getEgo))
                )(else
                    (if ((send gOwner:script))
                        (send ((send gOwner:script)):cue())
                    )
                    (self:cue())
                )
            )
            (case 4
                (leopard:
                    view(631)
                    y(+ (leopard:y) 6)
                    cel(0)
                    setPri(-1)
                    setLoop(6)
                    setCycle(End self)
                )
            )
            (case 5
                (leopard:setScript(leopardApproach 0 0))
                (self:dispose())
            )
        )
    )

)
(instance assistDuck of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                localproc_07dd()
                (if (== (leopardAttack:state) 1)
                    (leopardAttack:cue())
                )
                (if (== (send gOwner:trySkill(2 (+ local20 20))) -1)
                    = local13 1
                    = local21 0
                )(else
                    = local20 (+ local20 5)
                    = local13 0
                )
                (send gOwner:
                    view(29)
                    cel(0)
                    loop(local22)
                    setCycle(CT 3 1 self)
                )
            )
            (case 1
                0
            )
            (case 2
                (send gOwner:
                    cycleSpeed(12)
                    setCycle(CT 9 1 self)
                )
            )
            (case 3
                (send gOwner:
                    view(12)
                    cycleSpeed(6)
                    setLoop(local22)
                    setCycle(Walk)
                )
                (self:dispose())
            )
        )
    )

)
(instance duckOnly of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                localproc_07dd()
                (send gOwner:
                    view(29)
                    cel(0)
                    loop(local22)
                    setCycle(End self)
                )
            )
            (case 1
                (send gOwner:
                    view(12)
                    cycleSpeed(6)
                    setLoop(local22)
                    origStep(257)
                    setCycle(Walk)
                )
                localproc_081c()
                (self:dispose())
            )
        )
    )

)
(instance duckDown of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                localproc_07dd()
                (if (== (send gOwner:trySkill(2 (+ local20 20))) -1)
                    = local13 1
                    = local21 0
                )(else
                    = local20 (+ local20 5)
                    = local13 0
                )
                (send gOwner:
                    view(29)
                    cel(0)
                    loop(local22)
                    setCycle(CT 3 1 self)
                )
            )
            (case 1
                0
            )
            (case 2
                (send gOwner:
                    cycleSpeed(12)
                    setCycle(CT 9 1 self)
                )
            )
            (case 3
                (send gOwner:
                    view(12)
                    cycleSpeed(6)
                    setLoop(local22)
                    origStep(257)
                    setCycle(Walk)
                )
                (self:dispose())
            )
        )
    )

)
(instance assistJump of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                localproc_07dd()
                (if (== (leopardAttack:state) 1)
                    (leopardAttack:cue())
                )
                = cycles 1
            )
            (case 1
                = cycles 10
            )
            (case 2
                (if (== (send gOwner:trySkill(2 (+ local20 20))) -1)
                    = local13 1
                    = local21 0
                )(else
                    = local20 (+ local20 5)
                    = local13 0
                )
                (send gLongSong2:
                    number(250)
                    setLoop(1)
                    play()
                )
                (send gOwner:
                    view(30)
                    cel(0)
                    cycleSpeed(5)
                    moveSpeed(5)
                    setLoop(local22)
                    setCycle(JumpCycler 1 5)
                    setMotion(JumpX 53 self)
                )
            )
            (case 3
                (send gOwner:
                    view(12)
                    moveSpeed(6)
                    cycleSpeed(6)
                    setLoop(local22)
                    setCycle(Walk)
                )
                (self:dispose())
            )
        )
    )

)
(instance jumpUp of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                localproc_07dd()
                (if (== (send gOwner:trySkill(2 (+ local20 20))) -1)
                    = local13 1
                    = local21 0
                )(else
                    = local20 (+ local20 5)
                    = local13 0
                )
                (send gLongSong2:
                    number(250)
                    setLoop(1)
                    play()
                )
                (send gOwner:
                    view(30)
                    cel(0)
                    cycleSpeed(5)
                    moveSpeed(5)
                    setLoop(local22)
                    setCycle(JumpCycler 1 5)
                    setMotion(JumpX 53 self)
                )
            )
            (case 1
                (send gOwner:
                    view(12)
                    moveSpeed(6)
                    cycleSpeed(6)
                    setLoop(local22)
                    setCycle(Walk)
                )
                localproc_081c()
                (self:dispose())
            )
        )
    )

)
(instance preCrossing of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gOwner:setMotion(MoveTo 151 (send gOwner:y) self))
            )
            (case 1
                (send global2:setScript(ropeCrossing 0 0))
            )
        )
    )

)
(instance crossCheck of Code
    (properties)

    (method (doit)
        (if (< (send gOwner:x) 166)
            (send ((send global2:script)):register(0))
            (bridgeControls:state((& (bridgeControls:state) $ffdf)))
            proc0_2()
            (send gOwner:solvePuzzle(301 8 4))
            (moveForward:dispose())
            (leopardAttack:dispose())
            (if (not local14 and not proc0_6(66))
                (leopard:setCycle(Walk))
                (leopard:cue())
                (leopard:cue())
            )
            (send global2:setScript(preCrossing))
        )
    )

)
(instance backCheck of Code
    (properties)

    (method (doit)
        (if (> (send gOwner:x) 302)
            (bridgeControls:state((& (bridgeControls:state) $ffdf)))
            (moveForward:dispose())
            (leopardAttack:dispose())
            (send global2:setScript(egoDown))
        )
    )

)
(instance stepCheck of Code
    (properties)

    (method (doit)
        (if (< (send gOwner:x) 270)
            (moveForward:dispose())
            (leopardAttack:dispose())
            = local21 2
            (send global2:setScript(egoFell 0 1))
        )
    )

)
(instance leopard of Actor
    (properties
        x 259
        y 182
        noun 7
        view 631
        loop 1
        cel 7
        signal $4000
    )

    (method (init param1)
        (super:init(rest param1))
        (self:
            yStep(1)
            setCycle(Walk)
            hide()
        )
    )


    (method (doVerb theVerb)
        (var temp0)
        (if (proc999_5(theVerb 24 28 27))
            = temp0 
                (switch (theVerb)
                    (case 28
                        18
                    )
                    (case 27
                        17
                    )
                    (case 24
                        14
                    )
                )
            (if (not proc0_6(66))
                proc0_4(66)
                (send gOwner:
                    drop(temp0 1)
                    solvePuzzle(300 5 4)
                    addHonor(20)
                )
                (send global2:setScript(throwFood))
            )(else
                (send gOwner:drop(temp0 1))
                (send gQg3Messager:say(11 6 27))
            )
        )(else
            (if (proc999_5(theVerb 20 33 16))
                (send gOwner:addHonor(-30))
                (send gQg3Messager:say(1 6 12))
            )(else
                (super:doVerb(theVerb))
            )
        )
    )


    (method (cue)
        (leopard:
            setLoop(-1)
            setMotion(xDPath 259 182 281 161 240 121 179 149)
        )
    )


    (method (setHeading param1 param2)
        (if (not & signal $0800)
            = param1 (+ param1 45)
            (super:setHeading(param1 rest param2))
            = loop 
                (switch (loop)
                    (case 0
                        2
                    )
                    (case 1
                        1
                    )
                    (case 2
                        0
                    )
                    (case 3
                        3
                    )
                )
        )
    )

)
(instance leopardLady of View
    (properties
        x 292
        y 119
        z 30
        noun 1
        view 974
        loop 5
        priority 1
        signal $0010
    )
)
(instance theHut of Feature
    (properties
        x 126
        y 27
        noun 3
        onMeCheck $0002
    )

    (method (doVerb theVerb)
        (if (((== theVerb 16) and (send ((send gInv:at(6))):state)) and not local15)
            = local15 1
            (send gOwner:solvePuzzle(299 5 4))
            (send global2:setScript(ropeThrow))
        )(else
            (super:doVerb(theVerb))
        )
    )

)
(instance rope of Prop
    (properties
        x 310
        y 70
        view 630
        priority 10
        signal $4010
    )
)
(instance egoTell of Teller
    (properties)
)
(instance johariTell of Teller
    (properties)
)
(instance bridgeControls of GloryControls
    (properties)

    (method (init param1)
        (super:init(rest param1))
        = local28 1
        = window bridgeWin
        (User:input(1))
        (send gGame:setCursor(999))
        = icon1 iconJump
        = icon2 iconDrop
        = icon3 iconPush
        = icon4 iconPull
        = icon5 iconL
        = icon6 iconR
        = icon7 iconQuit
        (self:
            add(iconJump iconDrop iconPush iconPull iconL iconR iconQuit iconDummy)
            eachElementDo(213 -1)
            eachElementDo(212 -1)
            eachElementDo(14 129)
        )
        (self:disable(iconPush iconPull iconQuit))
        (if (== gGClientModNum 640)
            (self:disable(iconL))
        )(else
            (self:disable(iconR))
        )
        SetCursor(121 43 182 127)
    )


    (method (dispose)
        = local11 0
        (super:dispose())
    )


    (method (show)
        (if (local11)
            (send window:open())
            (self:eachElementDo(217))
        )(else
            = local11 1
            (super:show())
        )
    )


    (method (hide)
        SetCursor(-2)
        (super:hide())
    )


    (method (dispatchEvent param1)
        (var temp0, temp1)
        = gLastTicks GetTime()
        Animate((send gGQg3KDHandler:elements) 1)
        (if (global37)
            = global37 0
            (send gGQg3KDHandler:eachElementDo(246))
        )
        = temp0 (send param1:type)
        return 
            (if (& temp0 $0040)
                = temp0 (& temp0 $ffbf)
                (switch ((send param1:message))
                    (case 1
                        return 0
                    )
                    (case 5
                        return 0
                    )
                    (default 
                        (super:dispatchEvent(param1))
                    )
                )
            )(else
                = temp1 (send param1:message)
                (if (== temp0 4)
                    (if (== temp1 56)
                        return 0
                    )(else
                        (if (== temp1 50)
                            return 0
                        )(else
                            (super:dispatchEvent(param1))
                        )
                    )
                )(else
                    (super:dispatchEvent(param1))
                )
            )
    )

)
(instance iconJump of IconI
    (properties
        view 470
        loop 1
        cel 0
        nsLeft 2
        nsTop 2
        maskView 470
        maskLoop 10
    )

    (method (select)
        return 
            (if ((super:select()))
                (if (not 
                (if ((send gOwner:script))
                )(else
                    (send gOwner:mover)
                )
)
                    (if ((== global209 2) and not local12)
                        (send gOwner:setScript(assistJump))
                    )(else
                        (send gOwner:setScript(jumpUp))
                    )
                )
                return 1
            )(else
                0
            )
    )


    (method (highlight param1)
        (if (not & signal $0020)
            return 
        )
        (if (param1)
            DrawCel(view loop 2 nsLeft nsTop)
        )(else
            DrawCel(view loop 0 nsLeft nsTop)
        )
    )


    (method (onMe param1)
        (if ((super:onMe(param1)) and not IsItSkip(view loop cel (- (send param1:y) nsTop) (- (send param1:x) nsLeft)))
            (self:highlight(1))
        )(else
            (self:highlight(0))
        )
    )

)
(instance iconR of IconI
    (properties
        view 470
        loop 9
        cel 0
        nsLeft 60
        nsTop 12
        maskView 470
        maskLoop 10
        maskCel 5
    )

    (method (select param1)
        return 
            (if (not (& signal $0004) and (super:select(rest param1)))
                (if (proc0_6(66))
                    (send gOwner:setScript(moveStraight))
                )(else
                    (if (not 
                    (if ((send gOwner:script))
                    )(else
                        (send gOwner:mover)
                    )
)
                        (send gOwner:setScript(moveForward))
                    )
                )
                return 1
            )(else
                0
            )
    )


    (method (highlight param1)
        (if (param1)
            DrawCel(view loop 2 nsLeft nsTop)
        )(else
            DrawCel(view loop 0 nsLeft nsTop)
        )
    )


    (method (onMe param1)
        return 
            (if (not & signal $0004)
                (if ((super:onMe(param1)) and not IsItSkip(view loop cel (- (send param1:y) nsTop) (- (send param1:x) nsLeft)))
                    (self:highlight(1))
                )(else
                    (self:highlight(0))
                )
                return 1
            )(else
                return 0
            )
    )

)
(instance iconL of IconI
    (properties
        view 470
        loop 8
        cel 0
        nsLeft 3
        nsTop 12
        maskView 470
        maskLoop 10
        maskCel 4
    )

    (method (select param1)
        return 
            (if (not (& signal $0004) and (super:select(rest param1)))
                (if (proc0_6(66))
                    (send gOwner:setScript(moveStraight))
                )(else
                    (if (not 
                    (if ((send gOwner:script))
                    )(else
                        (send gOwner:mover)
                    )
)
                        (send gOwner:setScript(moveForward))
                    )
                )
                return 1
            )(else
                0
            )
    )


    (method (highlight param1)
        (if (not & signal $0020)
            return 
        )
        (if (param1)
            DrawCel(view loop 2 nsLeft nsTop)
        )(else
            DrawCel(view loop 0 nsLeft nsTop)
        )
    )


    (method (onMe param1)
        return 
            (if (not & signal $0004)
                (if ((super:onMe(param1)) and not IsItSkip(view loop cel (- (send param1:y) nsTop) (- (send param1:x) nsLeft)))
                    (self:highlight(1))
                )(else
                    (self:highlight(0))
                )
                return 1
            )(else
                return 0
            )
    )

)
(instance iconPush of IconI
    (properties
        view 470
        loop 10
        cel 2
        nsLeft 2
        nsTop 34
        signal $0004
        maskView 470
        maskLoop 10
        maskCel 2
    )

    (method (onMe param1)
        return 
            (if ((super:onMe(param1)) and not IsItSkip(view loop cel (- (send param1:y) nsTop) (- (send param1:x) nsLeft)))
                return 1
            )(else
                return 0
            )
    )

)
(instance iconPull of IconI
    (properties
        view 470
        loop 10
        cel 3
        nsLeft 52
        nsTop 34
        signal $0004
        maskView 470
        maskLoop 10
        maskCel 3
    )

    (method (onMe param1)
        return 
            (if ((super:onMe(param1)) and not IsItSkip(view loop cel (- (send param1:y) nsTop) (- (send param1:x) nsLeft)))
                return 1
            )(else
                return 0
            )
    )

)
(instance iconDrop of IconI
    (properties
        view 470
        loop 2
        cel 0
        nsLeft 51
        nsTop 2
        maskView 470
        maskLoop 10
        maskCel 1
    )

    (method (select param1)
        return 
            (if ((super:select(rest param1)))
                (if ((send gOwner:script) or (send gOwner:mover))
                    return 1
                )(else
                    (if (proc0_6(66) or local14)
                        (send gOwner:setScript(duckOnly))
                    )(else
                        (if (== global209 2)
                            (if (not local12)
                                (send gOwner:setScript(assistDuck))
                            )(else
                                (send gOwner:setScript(duckOnly))
                            )
                        )(else
                            (if ((leopard:script))
                                (send gOwner:setScript(duckDown))
                            )(else
                                (send gOwner:setScript(duckOnly))
                            )
                        )
                    )
                )
                return 1
            )(else
                0
            )
    )


    (method (highlight param1)
        (if (param1)
            DrawCel(view loop 2 nsLeft nsTop)
        )(else
            DrawCel(view loop 0 nsLeft nsTop)
        )
    )


    (method (onMe param1)
        (if ((super:onMe(param1)) and not IsItSkip(view loop cel (- (send param1:y) nsTop) (- (send param1:x) nsLeft)))
            (self:highlight(1))
        )(else
            (self:highlight(0))
        )
    )

)
(instance iconQuit of IconI
    (properties
        view 470
        loop 7
        cel 0
        nsLeft 24
        nsTop 2
        signal $0004
        maskView 470
        maskLoop 7
        maskCel 2
    )

    (method (onMe param1)
        return 
            (if ((super:onMe(param1)) and not IsItSkip(view loop cel (- (send param1:y) nsTop) (- (send param1:x) nsLeft)))
                return 1
            )(else
                return 0
            )
    )

)
(instance iconDummy of IconI
    (properties)

    (method (show)
    )


    (method (onMe)
        return 0
    )

)
(instance bridgeWin of Window
    (properties
        top 111
        left 45
        bottom 175
        right 125
        color 17
        back 17
    )

    (method (open param1)
        (super:open(rest param1))
        DrawCel(470 0 0 0 0 -1)
    )

)
(instance skull of Feature
    (properties
        x 28
        y 112
        noun 6
        nsTop 81
        nsLeft 7
        nsBottom 143
        nsRight 50
    )
)
(instance doorway of Feature
    (properties
        x 119
        y 47
        noun 8
        nsTop 30
        nsLeft 108
        nsBottom 64
        nsRight 130
    )

    (method (doVerb theVerb)
        (if (== theVerb 16)
            (theHut:doVerb(theVerb))
        )(else
            (super:doVerb(theVerb))
        )
    )

)
(instance treehouse of Feature
    (properties
        x 131
        y 38
        noun 9
        nsTop 11
        nsLeft 66
        nsBottom 65
        nsRight 197
    )

    (method (doVerb theVerb)
        (if (== theVerb 16)
            (theHut:doVerb(theVerb))
        )(else
            (super:doVerb(theVerb))
        )
    )

)
(instance tree of Feature
    (properties
        x 132
        y 100
        noun 10
        nsTop 71
        nsLeft 83
        nsBottom 130
        nsRight 181
    )

    (method (doVerb theVerb)
        (if (== theVerb 16)
            (theHut:doVerb(theVerb))
        )(else
            (super:doVerb(theVerb))
        )
    )

)
(instance sFx of Sound
    (properties)
)
(instance quest of GameControls
    (properties)

    (method (init param1)
        (send gGame:setCursor(999))
        (send (= window (GloryWindow:new())):
            top(60)
            left(82)
            bottom(130)
            right(238)
            priority(15)
            yourself()
        )
        (self:add(titleIcon yesIcon noIcon))
        (super:init(rest param1))
    )

)
(instance titleIcon of IconI
    (properties
        view 935
        loop 2
        cel 0
        nsTop 0
        signal $0004
        maskView 361
        maskLoop 3
    )

    (method (show)
        (var temp0[50])
        Message(0 630 2 6 3 1 @temp0)
        Display(@temp0 106 155 100 5 3 102 17)
    )

)
(instance yesIcon of IconI
    (properties
        view 935
        loop 2
        cel 0
        nsTop 38
        signal $0101
        maskView 361
        maskLoop 3
    )

    (method (show)
        = nsRight 80
        = nsBottom (+ nsTop 15)
        DrawCel(view loop cel nsLeft nsTop -1)
        Display(@local1 100 20 + nsTop 3 102 17)
        (if (& signal $0004)
            (self:mask())
        )
        (if (gPseudoMouse and (send gPseudoMouse:respondsTo(#stop)))
            (send gPseudoMouse:stop())
        )
    )


    (method (select)
        = local0 1
        (quest:state((& (quest:state) $ffdf)))
    )


    (method (highlight param1)
        (var temp0)
        (if (param1)
            DrawCel(view loop 1 nsLeft nsTop -1)
            = temp0 46
        )(else
            DrawCel(view loop 0 nsLeft nsTop -1)
            = temp0 17
        )
        Display(@local1 100 20 + nsTop 3 102 temp0)
    )

)
(instance noIcon of IconI
    (properties
        view 935
        loop 2
        cel 0
        nsTop 53
        signal $0101
        maskView 361
        maskLoop 3
    )

    (method (show)
        (var temp0[15])
        = nsRight 80
        = nsBottom (+ nsTop 15)
        DrawCel(view loop cel nsLeft nsTop -1)
        Display(@local6 100 20 + nsTop 3 102 17)
        (if (& signal $0004)
            (self:mask())
        )
        (if (gPseudoMouse and (send gPseudoMouse:respondsTo(#stop)))
            (send gPseudoMouse:stop())
        )
    )


    (method (select)
        = local0 0
        (quest:state((& (quest:state) $ffdf)))
    )


    (method (highlight param1)
        (var temp0)
        (if (param1)
            DrawCel(view loop 1 nsLeft nsTop -1)
            = temp0 46
        )(else
            DrawCel(view loop 0 nsLeft nsTop -1)
            = temp0 17
        )
        Display(@local6 100 20 + nsTop 3 102 temp0)
    )

)
