(version 2)
(include "sci.sh")
(exports
    0 rm290
    1 salimTalker
)
(use "Main")
(use "TellerIcon")
(use "n026")
(use "OccasionalCycle")
(use "Vendor")
(use "GloryTalker")
(use "Scaler")
(use "PolyPath")
(use "Polygon")
(use "CueObj")
(use "Sound")
(use "Cycle")
(use "Game")
(use "User")
(use "View")
(use "Obj")
(script 290)


(local
    local0 =     10
    local1
    local2
    local3
    local4
    local5 =     150
    local6 =     150
    theVendor
    local8
    local9[14] = (0 -68 -69 -1 2 -70 79 74 75 76 78 77 -110 999 )
    local23[4]
    local27[21] = (0 -49 -65 -54 -60 -66 -33 -35 -37 -39 -41 -43 -5 -29 -111 -30 85 -81 -57 -47 999 )
    local48[6] = (0 45 80 -44 46 999 )
    local54[3] = (0 -20 999 )
    local57[4] = (0 21 22 999 )
    local61[3] = (0 -112 999 )
    local64[3] = (0 -25 999 )
    local67[5] = (0 -24 26 -27 999 )
    local72[3] = (0 71 999 )
    local75[3] = (0 28 999 )
    local78[3] = (0 -34 999 )
    local81[3] = (0 103 999 )
    local84[3] = (0 36 999 )
    local87[3] = (0 38 999 )
    local90[3] = (0 40 999 )
    local93[3] = (0 42 999 )
    local96[4] = (0 50 51 999 )
    local100[3] = (0 67 999 )
    local103[4] = (0 55 56 999 )
    local107[3] = (0 -61 999 )
    local110[5] = (0 63 62 64 999 )
    local115[3] = (0 53 999 )
    local118[4] = (0 -58 59 999 )
    local122[3] = (0 -19 999 )
    local125[3] = (0 48 999 )
    local128[28]
    local156[26] = (0 -49 -65 -54 -60 -61 -66 -33 -34 -35 -37 -39 -41 -43 -44 -20 -5 -29 -25 -24 -27 -111 -57 -58 -47 999 )

)
(procedure (localproc_054c param1)
    = global395 (| global395 param1)
)


(procedure (localproc_0556 param1)
    = global395 (& global395 bnot param1)
)


(procedure (localproc_0561 param1)
    return & global395 param1
)


(procedure (localproc_0568 param1)
    (var temp0)
    = temp0 (send gInv:at(param1))
    return == (send temp0:state) global2
)


(instance public rm290 of Rm
    (properties
        noun 25
        picture 290
        vanishingY -100
    )

    (method (init)
        (send gLongSong:
            hold(0)
            holdVal(0)
            setVol(127)
        )
        proc0_2()
        (if (localproc_0561(16384))
            localproc_0556(16384)
        )
        (if (not global395)
            localproc_054c(1)
            (salim:
                loop(0)
                cel(0)
            )
            (Book:show())
        )(else
            (if (localproc_0561(1))
                localproc_0556(1)
                localproc_054c(2)
                (salim:
                    loop(2)
                    cel(0)
                )
                (Book:hide())
            )(else
                (if (localproc_0561(2))
                    localproc_0556(2)
                    localproc_054c(4)
                )(else
                    (if (localproc_0561(4) and localproc_0561(4096))
                        localproc_0556(4)
                        localproc_054c(8)
                    )
                )
            )
        )
        (send gOwner:
            init()
            x(135)
            y(192)
            normalize()
            setScale(Scaler 113 87 150 110)
            noun(2)
        )
        (self:setScript(sEnter))
        (super:init())
        (send global2:addObstacle((send ((Polygon:new())):
                type(3)
                init(173 170 181 170 203 158 212 141 207 141 187 143 176 144 163 144 140 144 129 147 110 147 106 139 114 129 125 121 152 124 153 118 139 117 140 114 123 114 116 121 107 127 98 133 83 148 77 165 95 171 95 189 173 189)
                yourself()
            )
 (send ((Polygon:new())):
                type(2)
                init(123 148 150 146 173 146 171 157 162 160 155 161 131 160 125 156)
                yourself()
            )
))
        (salim:init())
        (salimVendor:init())
        = local23[0] @local9
        = local128[0] @local27
        = local128[1] @local96
        = local128[2] @local100
        = local128[3] @local103
        = local128[4] @local107
        = local128[5] @local110
        = local128[6] @local115
        = local128[7] @local78
        = local128[8] @local81
        = local128[9] @local84
        = local128[10] @local87
        = local128[11] @local90
        = local128[12] @local93
        = local128[13] @local48
        = local128[14] @local54
        = local128[15] @local57
        = local128[16] @local61
        = local128[17] @local64
        = local128[18] @local67
        = local128[19] @local72
        = local128[20] @local75
        = local128[21] @local67
        = local128[22] @local118
        = local128[23] @local122
        = local128[24] @local125
        (egoTell:init(gOwner @local9 @local23))
        (salimTell:init(salim @local27 @local128 @local156))
        (Cushion1:
            init()
            setScale()
            addToPic()
        )
        (Cushion2:
            init()
            setScale()
            approachVerbs(4)
            stopUpd()
        )
        (Book:
            init()
            setScale()
            stopUpd()
        )
        (pipe:init())
        (spiderplant:init())
        ({pile-o-books}:init())
        ({up-left-blue-bottle}:init())
        ({up-left-plant}:init())
        ({low-left-blue-bottle}:init())
        ({left-mid-bottles}:init())
        (table:init())
        (greenvase:init())
        (beadeddoor:init())
        ({giant-red-pot}:init())
        (roundpot:init())
        ({low-hang-plat}:init())
        ({small-spider-plant}:init())
        (rightpots:init())
        (plantshelf:init())
        ({upper-shelf}:init())
        (brownbottles:init())
        (morebottles:init())
        ({bottles-over-door}:init())
        (hookedbottle:init())
        (send gQg3Walkers:addToFront(global2))
        (if (localproc_0568(30))
            = global405 9999
        )(else
            (if (not global405)
                = global405 4
            )
        )
    )


    (method (doit)
        (if (script)
            0
        )(else
            (if ((send gOwner:mover) and (== (send gOwner:view) 40))
                (if (IsObject((send gOwner:looper)))
                    (send ((send gOwner:looper)):dispose())
                )
                (send gOwner:
                    setMotion(0)
                    setScript(stand)
                )
            )(else
                (if (> (send gOwner:y) 170)
                    proc0_2()
                    (self:setScript(sExit))
                )
            )
        )
        (super:doit())
    )


    (method (dispose)
        (send gQg3Walkers:delete(global2))
        (super:dispose())
    )


    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 3
                (egoActions:doVerb(3))
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance sExit of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:setMotion(PolyPath 135 185 self))
            )
            (case 1
                (send gOwner:setMotion(MoveTo 135 225 self))
            )
            (case 2
                (send global2:newRoom(270))
            )
        )
    )

)
(instance sEnter of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gOwner:setMotion(PolyPath 165 160 self))
            )
            (case 1
                (if (localproc_0561(1))
                    (salim:setLoop(0))
                    (Book:show())
                    = cycles 5
                )(else
                    (if (localproc_0561(2))
                        (salim:setLoop(2))
                        = cycles 5
                    )(else
                        (if (localproc_0561(4))
                            (if (% global396 2)
                                (Book:hide())
                                (salim:setLoop(0))
                                = cycles 5
                            )(else
                                (Book:hide())
                                (salim:setLoop(2))
                                = cycles 5
                            )
                        )(else
                            (if (localproc_0561(8))
                                (Book:show())
                                (salim:setLoop(0))
                                = cycles 5
                            )(else
                                (Book:hide())
                                (salim:setLoop(2))
                                = cycles 5
                            )
                        )
                    )
                )
            )
            (case 2
                (if (localproc_0561(1))
                    (send gQg3Messager:say(1 6 10))
                )(else
                    (if (localproc_0561(2))
                        (if (localproc_0561(256))
                            (send gQg3Messager:say(1 6 2))
                        )(else
                            (send gQg3Messager:say(1 6 11))
                        )
                        = global396 1
                    )(else
                        (if (localproc_0561(4))
                            (if (== global396 1)
                                (send gQg3Messager:say(1 6 12))
                                ++global396
                            )(else
                                (if (== global396 2)
                                    (send gQg3Messager:say(1 6 13))
                                    ++global396
                                )(else
                                    (if (== global396 3)
                                        (send gQg3Messager:say(1 6 14))
                                        ++global396
                                    )(else
                                        (if (== global396 4)
                                            (send gQg3Messager:say(1 6 15))
                                            ++global396
                                        )(else
                                            (send gQg3Messager:say(1 6 11))
                                            = global396 1
                                        )
                                    )
                                )
                            )
                        )(else
                            (if (localproc_0561(8))
                                (if (== global396 global122)
                                    (send gQg3Messager:say(1 6 18))
                                )(else
                                    (send gQg3Messager:say(1 6 17))
                                    = global396 0
                                )
                            )(else
                                (if (== global396 0)
                                    (send gQg3Messager:say(1 6 16))
                                    ++global396
                                )(else
                                    (if (== global396 1)
                                        (send gQg3Messager:say(1 6 11))
                                        ++global396
                                    )(else
                                        (if (== global396 2)
                                            (send gQg3Messager:say(1 6 12))
                                            ++global396
                                        )(else
                                            (if (== global396 3)
                                                (send gQg3Messager:say(1 6 13))
                                                ++global396
                                            )(else
                                                (if (== global396 4)
                                                    (send gQg3Messager:say(1 6 14))
                                                    ++global396
                                                )(else
                                                    (if (== global396 5)
                                                        (send gQg3Messager:say(1 6 14))
                                                        = global396 0
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
                (self:cue())
            )
            (case 3
                (salim:setCycle(OccasionalCycle self 1 60 150))
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance lookUp of Script
    (properties)

    (method (changeState newState)
        (var temp0[20])
        (switch (= state newState)
            (case 0
                proc0_2()
                (if (== (salim:loop) 3)
                    (salim:setCycle(Beg self))
                )(else
                    (self:cue())
                )
            )
            (case 1
                (send gQg3Messager:say(1 6 32 0 self))
            )
            (case 2
                (Book:hide())
                (salim:
                    cycleSpeed(5)
                    loop(1)
                    setCycle(Fwd)
                )
                (send gLongSong2:
                    number(928)
                    setLoop(-1)
                    play()
                )
                = seconds 5
            )
            (case 3
                (send gLongSong2:stop())
                (send gQg3Messager:say(1 6 4 0 self))
            )
            (case 4
                (salim:
                    cycleSpeed(18)
                    cel(0)
                    loop(2)
                    setCycle(OccasionalCycle self 1 60 150)
                )
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance tokeDeath of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gSounds:eachElementDo(170 0 1 15 1))
                DrawPic(0 -32761 dpCLEAR)
                (send gGQg3KDHandler:eachElementDo(111))
                = cycles 5
            )
            (case 1
                (send gQg3Messager:say(3 6 101 0 self))
            )
            (case 2
                proc26_0(97 0 294 Fwd 291)
            )
        )
    )

)
(instance freakOut of Script
    (properties)

    (method (doit)
        (if (local1)
            (if (< local0 20)
                ++local0
                Palette(palANIMATE 1 71 1 73 235 1)
            )(else
                (if (< local0 40)
                    ++local0
                    Palette(palANIMATE 1 71 1 73 235 -1)
                )(else
                    = local0 0
                )
            )
        )
        (super:doit())
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (if (== local4 1)
                    (send gQg3Messager:say(3 4 96 0 self))
                )(else
                    (self:cue())
                )
            )
            (case 1
                (send gLongSong:pause(1))
                (sFx:
                    number(291)
                    play()
                )
                = local3 Palette(palSAVE)
                = local1 1
                = ticks 270
            )
            (case 2
                (send gLongSong:pause(0))
                = local1 0
                Palette(palRESTORE local3)
                (switch (local4)
                    (case 1
                        (send gQg3Messager:say(3 4 98 0 self))
                    )
                    (case 2
                        (send gQg3Messager:say(3 4 99 0 self))
                    )
                    (case 3
                        (self:setScript(tokeDeath))
                    )
                )
            )
            (case 3
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance sit of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:setMotion(MoveTo 158 150 self))
            )
            (case 1
                (send gOwner:
                    view(40)
                    cel(0)
                    setLoop(2)
                    setCycle(End self)
                )
                (if ((send gOwner:looper))
                    (send ((send gOwner:looper)):dispose())
                    (send gOwner:looper(0))
                )
            )
            (case 2
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance stand of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:setCycle(Beg self))
            )
            (case 1
                (send gOwner:
                    normalize(6)
                    cel(0)
                    setMotion(PolyPath (send gOwner:x) - (send gOwner:y) 10 self)
                )
            )
            (case 2
                (send gOwner:setMotion(PolyPath local5 local6))
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance standUp of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gQg3Messager:say(2 5 1 0 self))
            )
            (case 1
                (send gQg3Messager:say(1 6 1 0 self))
            )
            (case 2
                (Book:show())
                (salim:
                    cel(0)
                    loop(3)
                    setCycle(End self)
                )
            )
            (case 3
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance egoTell of Teller
    (properties)

    (method (showDialog)
        (super:showDialog(-1 
            (if (localproc_0561(8192) and not localproc_0561(256))
                localproc_0561(3)
            )(else
                0
            )
 2 
            (if (localproc_0561(256) and not localproc_0561(16384))
                localproc_0561(3)
            )(else
                0
            )
 -70 not 
            (if (localproc_0561(8192))
            )(else
                localproc_0561(512)
            )
 79 localproc_0561(2048) 74 (send gOwner:has(30)) 75 (send gOwner:has(35)) 76 (send gOwner:has(36)) 78 (send gOwner:has(38)) 77 (send gOwner:has(37))))
    )


    (method (doChild param1)
        (var temp0)
        (if (== param1 -1)
            (if (not localproc_0561(256))
                (send gOwner:
                    solvePuzzle(246 10)
                    addHonor(40)
                )
                localproc_054c(256)
                localproc_054c(16384)
                (salim:setScript(standUp))
                return 0
            )
        )(else
            (if (== param1 -70)
                (if (not localproc_0561(8192))
                    localproc_054c(512)
                )
            )(else
                (if (== param1 -68)
                    (if (not localproc_0561(64))
                        localproc_054c(64)
                        (send gOwner:addHonor(2))
                    )
                )(else
                    (if (== param1 -69)
                        (if (not localproc_0561(128))
                            localproc_054c(128)
                            (send gOwner:addHonor(2))
                        )
                    )(else
                        (if (== param1 -110)
                            (salimTell:doVerb((send ((send gInv:at(0))):message)))
                            return 0
                        )
                    )
                )
            )
        )
        return 1
    )

)
(instance salimTell of Teller
    (properties)

    (method (showDialog)
        (super:showDialog(-33 localproc_0561(1) -35 localproc_0561(2) -37 localproc_0561(4) -39 localproc_0561(8) -41 localproc_0561(32) -5 
            (if (localproc_0561(7))
                not localproc_0561(1024)
            )(else
                0
            )
 -24 not localproc_0568(37) -27 not localproc_0568(35) 26 not localproc_0568(38) -81 
            (if (localproc_0561(512))
                localproc_0561(3)
            )(else
                0
            )
 -29 
            (if (localproc_0561(3))
                localproc_0561(1024)
            )(else
                0
            )
 -111 
            (if (localproc_0561(1024) and localproc_0561(4))
                not localproc_0561(4096)
            )(else
                0
            )
 -30 
            (if (localproc_0561(4096) and not localproc_0561(32))
                (== global396 global122)
            )(else
                0
            )
 85 
            (if (localproc_0561(8))
                (<> global396 global122)
            )(else
                0
            )
 -44 not localproc_0568(30) 80 localproc_0568(30) -49 localproc_0561(1) -65 localproc_0561(2) -54 localproc_0561(4) -60 localproc_0561(8) -66 localproc_0561(32) -57 localproc_0561(3) -47 localproc_0561(1) -58 localproc_0561(1)))
    )


    (method (doChild param1)
        (var temp0)
        return 
            (if (== param1 -20)
                (if (not proc0_6(83))
                    proc0_4(83)
                )
                (if (localproc_0561(1))
                    (super:doChild(param1))
                )(else
                    return 1
                )
            )(else
                (if (== param1 -57)
                    (if (localproc_0561(1))
                        (super:doChild(param1))
                    )(else
                        return 1
                    )
                )(else
                    (if (== param1 -19)
                        localproc_054c(8192)
                        return 1
                    )(else
                        (if (== param1 -81)
                            localproc_054c(8192)
                            return 1
                        )(else
                            (if (== param1 -112)
                                (if (not proc0_6(58))
                                    localproc_054c(1024)
                                    proc0_4(58)
                                    (salimTell:stuffArray(@local27 0))
                                    (send global2:setScript(lookUp))
                                )
                                return 0
                            )(else
                                (if (== param1 -29)
                                    (if (localproc_0561(4096))
                                        return 1
                                    )(else
                                        (super:doChild(param1))
                                    )
                                )(else
                                    (if (== param1 -30)
                                        return 1
                                    )(else
                                        (if (== param1 -44)
                                            (if (localproc_0561(32))
                                                return 1
                                            )(else
                                                (super:doChild(param1))
                                            )
                                        )(else
                                            (super:doChild(param1))
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
    )


    (method (doVerb theVerb param2)
        (var temp0[20], temp20)
        return 
            (if (== theVerb 59)
                (send gQg3Messager:say(1 59 31))
            )(else
                (if (== theVerb 10)
                    (if (not (salimVendor:goods))
                        (if (< global405 0)
                            = temp20 0
                        )(else
                            = temp20 global405
                        )
                        (if (not localproc_0561(-32768))
                            (if (localproc_0561(8))
                                (if (== global125 1)
                                    = global471 3
                                )(else
                                    = global471 2
                                )
                            )(else
                                = global471 1
                            )
                        )
                        (salimVendor:goods((send ((List:new())):add((send ((Class_47_1:new(29))):
                                    price(10)
                                    quantity(temp20)
                                )
 (send ((Class_47_1:new(27))):
                                    price(20)
                                    quantity(9999)
                                )
 (send ((Class_47_1:new(28))):
                                    price(20)
                                    quantity(9999)
                                )
 (send ((Class_47_1:new(30))):
                                    price(30)
                                    quantity(global471)
                                )
))))
                    )
                    (salimVendor:purchase())
                    return 1
                )(else
                    (if (== theVerb 48)
                        (if (proc0_6(58))
                            (if (proc0_6(243))
                                (send gQg3Messager:say(1 6 113))
                                return 1
                            )(else
                                (send gOwner:
                                    drop(37 1)
                                    solvePuzzle(243 3)
                                )
                                (send ((send gInv:at(37))):state(global2))
                                (send gQg3Messager:say(1 48 23))
                                (if (localproc_0568(35) and localproc_0568(38))
                                    localproc_0556(3)
                                    localproc_054c(4)
                                    localproc_054c(4096)
                                    = global396 global122
                                    (salimTell:stuffArray(@local27 0))
                                    (send gQg3Messager:say(1 6 82))
                                )(else
                                    (if (== (salimTell:curArray) @local72)
                                        (salimTell:stuffArray(@local67 0))
                                    )
                                )
                                return 1
                            )
                        )(else
                            (super:doVerb(theVerb rest param2))
                        )
                    )(else
                        (if (== theVerb 46)
                            (if (proc0_6(58))
                                (if (proc0_6(242))
                                    (send gQg3Messager:say(1 6 113))
                                    return 1
                                )(else
                                    (send gOwner:
                                        drop(35 1)
                                        solvePuzzle(242 3)
                                    )
                                    (send ((send gInv:at(35))):state(global2))
                                    (send gQg3Messager:say(1 46 23))
                                    (if (localproc_0568(37) and localproc_0568(38))
                                        localproc_0556(3)
                                        localproc_054c(4)
                                        localproc_054c(4096)
                                        = global396 global122
                                        (salimTell:stuffArray(@local27 0))
                                        (send gQg3Messager:say(1 6 82))
                                    )(else
                                        (if (== (salimTell:curArray) @local75)
                                            (salimTell:stuffArray(@local67 0))
                                        )
                                    )
                                    return 1
                                )
                            )(else
                                (super:doVerb(theVerb rest param2))
                            )
                        )(else
                            (if (== theVerb 49)
                                (if (proc0_6(58))
                                    (if (proc0_6(244))
                                        (send gQg3Messager:say(1 6 113))
                                        return 1
                                    )(else
                                        (send gOwner:
                                            drop(38 1)
                                            solvePuzzle(244 3)
                                        )
                                        (send ((send gInv:at(38))):state(global2))
                                        (send gQg3Messager:say(1 49 23))
                                        (if (localproc_0568(35) and localproc_0568(37))
                                            localproc_054c(4096)
                                            localproc_0556(3)
                                            localproc_054c(4)
                                            = global396 global122
                                            (send gQg3Messager:say(1 6 82))
                                            (salimTell:stuffArray(@local27 0))
                                        )
                                        return 1
                                    )
                                )(else
                                    (super:doVerb(theVerb rest param2))
                                )
                            )(else
                                (if (== theVerb 41)
                                    (send gOwner:
                                        drop(30)
                                        get(12 3)
                                        solvePuzzle(241 3)
                                    )
                                    (send ((send gInv:at(30))):state(global2))
                                    (send gQg3Messager:say(1 41 23))
                                    (if (not proc0_6(241))
                                        (send gOwner:addHonor(10))
                                    )
                                    return 1
                                )(else
                                    (super:doVerb(theVerb rest param2))
                                )
                            )
                        )
                    )
                )
            )
    )

)
(instance egoActions of Actions
    (properties)

    (method (doVerb theVerb)
        return 
            (switch (theVerb)
                (case 3
                    (if ((send global2:script))
                        0
                    )(else
                        (if (== (send gOwner:view) 40)
                            = local5 (send ((User:curEvent)):x)
                            = local6 (send ((User:curEvent)):y)
                            (send global2:setScript(stand))
                            return 1
                        )
                    )
                )
                (default 
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance Cushion1 of View
    (properties
        x 186
        y 136
        noun 32
        view 290
        signal $4010
        scaleX 132
        scaleY 132
    )
)
(instance Cushion2 of View
    (properties
        x 145
        y 153
        noun 31
        approachX 155
        approachY 160
        view 290
        priority 10
        signal $4010
        scaleX 155
        scaleY 155
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 4
                (if (<> (send gOwner:view) 40)
                    (send global2:setScript(sit))
                )(else
                    (super:doVerb(theVerb))
                )
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance Book of View
    (properties
        x 192
        y 133
        noun 15
        view 290
        loop 1
        priority 10
        signal $4010
        scaleX 132
        scaleY 132
    )
)
(instance salim of Prop
    (properties
        x 186
        y 134
        noun 1
        view 292
        cycleSpeed 18
    )
)
(instance public salimTalker of GloryTalker
    (properties
        x 1
        view 293
        loop 1
        cel 1
        talkWidth 265
        back 57
        textX 25
        textY 95
        backColor 116
    )

    (method (init param1)
        (super:init(salimBrow salimEyes salimMouth rest param1))
    )

)
(instance salimEyes of Prop
    (properties
        nsTop 31
        nsLeft 39
        view 293
        loop 2
        priority 15
        signal $0010
    )
)
(instance salimBrow of Prop
    (properties
        x 50
        y 50
        nsTop 21
        nsLeft 31
        view 293
        loop 3
        priority 14
        signal $0010
    )
)
(instance salimMouth of Prop
    (properties
        nsTop 47
        nsLeft 42
        view 293
        priority 15
        signal $0010
    )
)
(instance salimVendor of Vendor
    (properties
        noun 26
    )

    (method (transact param1 param2)
        = theVendor self
        (switch (param1)
            (case 0
                proc47_3(param1 param2)
                (if (not (send ((send goods:at(param1))):quantity))
                    = global405 -1
                    (send gOwner:get(12 param2))
                    (send gQg3Messager:say(1 6 3 0 self))
                )(else
                    (if (not > global405 4)
                        = global405 (- global405 param2)
                    )
                    (send gOwner:get(12 param2))
                    (self:cue())
                )
            )
            (case 1
                (send gOwner:get(13 param2))
                proc47_3(param1 param2)
                (self:cue())
            )
            (case 2
                (send gOwner:get(11 param2))
                proc47_3(param1 param2)
                (self:cue())
            )
            (case 3
                (if (not localproc_0561(1024))
                    localproc_054c(1024)
                    proc0_4(58)
                    (salimTell:stuffArray(@local27 0))
                    (self:setScript(lookUp self))
                )(else
                    (if (not localproc_0561(-32768))
                        (if (not localproc_0561(4096))
                            (send gQg3Messager:say(1 6 84 0 self))
                        )(else
                            (if (== global396 global122)
                                (send gQg3Messager:say(1 6 114 0 self))
                            )(else
                                localproc_0556(8)
                                localproc_054c(32)
                                (if (localproc_0561(256))
                                    (send gOwner:
                                        get(16 global471)
                                        solvePuzzle(245 6)
                                    )
                                    = global471 0
                                    (send ((send goods:at(param1))):quantity(0))
                                    localproc_054c(-32768)
                                    (send gQg3Messager:say(1 6 6 0 self))
                                )(else
                                    (send gOwner:
                                        get(16 param2)
                                        solvePuzzle(245 6)
                                    )
                                    = global471 (- global471 param2)
                                    proc47_3(param1 param2)
                                    localproc_054c(-32768)
                                    (self:cue())
                                )
                            )
                        )
                    )(else
                        (send gOwner:get(16 param2))
                        = global471 (- global471 param2)
                        proc47_3(param1 param2)
                        (self:cue())
                    )
                )
            )
        )
    )


    (method (doBargain param1)
        (switch (param1)
            (case 1
                (send gQg3Messager:say(1 6 87 0 self))
            )
            (case 2
                (send gQg3Messager:say(1 6 88 0 self))
            )
            (case 3
                (send gQg3Messager:say(1 6 90 0 self))
            )
            (case 4
                (send gQg3Messager:say(1 6 89 0 self))
            )
            (case 5
                (send gQg3Messager:say(1 6 91 0 self))
            )
            (case 6
                (send gQg3Messager:say(1 6 92 0 self))
            )
            (default 
                (self:cue())
            )
        )
    )

)
(instance pipe of Feature
    (properties
        x 143
        y 120
        noun 3
        nsTop 100
        nsLeft 130
        nsBottom 131
        nsRight 156
        sightAngle 40
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 19
                (if (== (send gOwner:view) 40)
                    (if (not local2)
                        = local2 1
                        (send gQg3Messager:say(3 19 93))
                    )(else
                        (send gQg3Messager:say(3 19 94))
                    )
                )(else
                    (send gQg3Messager:say(3 6 100))
                )
            )
            (case 4
                (if (== (send gOwner:view) 40)
                    (if (local2)
                        ++local4
                        (rm290:setScript(freakOut))
                    )(else
                        (send gQg3Messager:say(3 4 95))
                    )
                )(else
                    (send gQg3Messager:say(3 6 100))
                )
            )
            (case 1
                (if (local2)
                    (send gQg3Messager:say(3 1 94))
                )(else
                    (send gQg3Messager:say(3 1 95))
                )
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance spiderplant of Feature
    (properties
        x 86
        y 52
        noun 4
        nsTop 35
        nsLeft 67
        nsBottom 70
        nsRight 105
        sightAngle 180
    )
)
(instance {pile-o-books} of Feature
    (properties
        x 53
        y 155
        noun 5
        nsTop 146
        nsLeft 40
        nsBottom 164
        nsRight 66
        sightAngle 180
    )
)
(instance {up-left-blue-bottle} of Feature
    (properties
        x 39
        y 76
        noun 6
        nsTop 71
        nsLeft 35
        nsBottom 82
        nsRight 44
        sightAngle 180
    )
)
(instance {up-left-plant} of Feature
    (properties
        x 42
        y 33
        noun 7
        nsTop 18
        nsLeft 34
        nsBottom 48
        nsRight 51
        sightAngle 180
    )
)
(instance {low-left-blue-bottle} of Feature
    (properties
        x 38
        y 135
        noun 8
        nsTop 131
        nsLeft 35
        nsBottom 140
        nsRight 42
        sightAngle 180
    )
)
(instance {left-mid-bottles} of Feature
    (properties
        x 44
        y 99
        noun 9
        nsTop 91
        nsLeft 35
        nsBottom 107
        nsRight 53
        sightAngle 180
    )
)
(instance table of Feature
    (properties
        x 90
        y 114
        noun 10
        nsTop 100
        nsLeft 80
        nsBottom 128
        nsRight 100
        sightAngle 180
    )
)
(instance greenvase of Feature
    (properties
        x 73
        y 132
        noun 11
        nsTop 120
        nsLeft 68
        nsBottom 144
        nsRight 79
        sightAngle 180
    )
)
(instance beadeddoor of Feature
    (properties
        x 130
        y 86
        noun 12
        nsTop 63
        nsLeft 118
        nsBottom 109
        nsRight 143
        sightAngle 180
    )
)
(instance {giant-red-pot} of Feature
    (properties
        x 166
        y 95
        noun 13
        nsTop 77
        nsLeft 156
        nsBottom 113
        nsRight 176
        sightAngle 180
    )
)
(instance roundpot of Feature
    (properties
        x 199
        y 162
        noun 14
        nsTop 156
        nsLeft 190
        nsBottom 169
        nsRight 209
        sightAngle 180
    )
)
(instance {low-hang-plat} of Feature
    (properties
        x 216
        y 97
        noun 16
        nsTop 79
        nsLeft 204
        nsBottom 116
        nsRight 228
        sightAngle 180
    )
)
(instance {small-spider-plant} of Feature
    (properties
        x 162
        y 51
        noun 17
        nsTop 43
        nsLeft 148
        nsBottom 59
        nsRight 176
        sightAngle 180
    )
)
(instance rightpots of Feature
    (properties
        x 258
        y 112
        noun 18
        nsTop 98
        nsLeft 248
        nsBottom 126
        nsRight 269
        sightAngle 180
    )
)
(instance plantshelf of Feature
    (properties
        x 230
        y 46
        noun 19
        nsTop 40
        nsLeft 194
        nsBottom 52
        nsRight 266
        sightAngle 180
    )
)
(instance {upper-shelf} of Feature
    (properties
        x 189
        y 32
        noun 20
        nsTop 29
        nsLeft 164
        nsBottom 36
        nsRight 214
        sightAngle 180
    )
)
(instance brownbottles of Feature
    (properties
        x 231
        y 131
        noun 21
        nsTop 116
        nsLeft 221
        nsBottom 146
        nsRight 242
        sightAngle 180
    )
)
(instance morebottles of Feature
    (properties
        x 243
        y 78
        noun 22
        nsTop 68
        nsLeft 227
        nsBottom 88
        nsRight 259
        sightAngle 180
    )
)
(instance {bottles-over-door} of Feature
    (properties
        x 132
        y 48
        noun 23
        nsTop 44
        nsLeft 121
        nsBottom 52
        nsRight 143
        sightAngle 180
    )
)
(instance hookedbottle of Feature
    (properties
        x 65
        y 101
        noun 24
        nsTop 92
        nsLeft 61
        nsBottom 111
        nsRight 69
        sightAngle 180
    )
)
(instance sFx of Sound
    (properties)
)
