(version 2)
(include "sci.sh")
(exports
    0 rm240
    2 aWeaponSeller
    3 aSanford
    4 aSon
    5 aHoneySeller
    6 aOilSeller
)
(use "Main")
(use "TellerIcon")
(use "Vendor")
(use "MerchantActor")
(use "PolyPath")
(use "Polygon")
(use "CueObj")
(use "n958")
(use "Timer")
(use "Cycle")
(use "Game")
(use "User")
(use "View")
(use "Obj")
(script 240)


(local
    local0 =     1
    aSanfordNoun
    local2
    local3
    local4
    local5
    local6
    local7
    local8
    local9
    local10 =     1
    local11
    aWeaponSellerInit[4]
    local16
    local17[9] = (0 -92 -93 -105 -43 -72 -97 -98 999 )
    local26[7] = (0 82 83 84 -86 -85 999 )
    local33[7] = (0 76 77 47 78 24 999 )
    local40[5] = (0 79 80 25 999 )
    local45[5] = (0 104 81 26 999 )
    local50[6] = (0 -36 35 -100 -101 999 )
    local56[7] = (0 37 38 39 40 2 999 )
    local63[3] = (0 -36 999 )
    local66[6] = (0 63 35 -100 -101 999 )
    local72[6] = (0 -48 35 -100 -101 999 )
    local78[4] = (0 49 -91 999 )
    local82[3] = (0 -48 999 )
    local85[6] = (0 52 35 -100 -101 999 )
    local91[4]
    local95[4]
    local99[4]
    local103[5]
    local108[5]
    local113[5]
    local118[5]

)
(procedure (localproc_0892)
    = local3 Random(0 3)
    (if (not local3)
        (if ((== (weaponSellerFirst:state) -1) or (== (weaponSellerFirst:state) 10))
            = local3 0
        )(else
            = local3 1
        )
    )
    = local0 0
    (send aWeaponSellerInit[local3]:
        cel(0)
        setCycle(End aOilSeller)
    )
)


(procedure (localproc_08de param1)
    (switch (param1)
        (case 1
            DisposeScript(245)
        )
        (case 7
            DisposeScript(246)
        )
        (case 6
            DisposeScript(246)
        )
        (case 4
            DisposeScript(247)
        )
        (case 5
            DisposeScript(248)
        )
    )
)


(instance public rm240 of Rm
    (properties
        noun 26
        picture 240
        horizon -20
        vanishingY -300
    )

    (method (init param1)
        proc958_0(143 240)
        (send gQg3Walkers:addToFront(self))
        (self:setRegions(51))
        (send gOwner:
            noun(2)
            init()
            normalize()
            edgeHit(0)
            scaleSignal(1)
            scaleX(120)
            scaleY(120)
        )
        (if (global121 or proc0_6(135))
            (send global2:addObstacle((send ((Polygon:new())):
                    type(2)
                    init(319 189 283 189 239 149 319 137)
                    yourself()
                )
 (send ((Polygon:new())):
                    type(2)
                    init(0 95 0 0 319 0 319 104 284 104 255 89 230 104 128 118 109 108 52 114)
                    yourself()
                )
))
            (if ((> global122 4) and not proc0_6(172))
                = local11 (| local11 $2000)
                (if ((<> global451 global122) and proc0_6(40))
                    (if (proc0_6(46))
                        proc0_4(47)
                    )(else
                        proc0_4(46)
                    )
                )
                (send gOwner:code(nightCode))
                (send (ScriptID(241 0)):
                    view(954)
                    loop(1)
                    cel(0)
                    x(149)
                    y(105)
                    init()
                    scaleSignal(1)
                    scaleX(120)
                    scaleY(120)
                )
                = local95[0] @local26
                (nightTell:init(gOwner @local26 @local95))
            )(else
                (send gOwner:code(nightCodeX))
            )
        )(else
            (if (<> (send gLongSong2:number) 924)
                (send gLongSong2:
                    number(924)
                    setLoop(-1)
                    play(127)
                )
            )
            (if (((<> (send gLongSong:number) 923) and (<> (send gLongSong:number) 230)) or ((== (send gLongSong:number) 923) and (== (send gLongSong:prevSignal) -1)))
                (send gLongSong:
                    setLoop(-1)
                    number(923)
                    play(60)
                )
            )(else
                (if (<> (send gLongSong:number) 230)
                    (send gLongSong:fade(60 10 5 0))
                )(else
                    (send gLongSong:client(self))
                )
            )
            (send global2:addObstacle((send ((Polygon:new())):
                    type(2)
                    init(240 189 141 189 114 165 218 150 262 186)
                    yourself()
                )
 (send ((Polygon:new())):
                    type(2)
                    init(319 189 273 189 236 146 319 137)
                    yourself()
                )
 (send ((Polygon:new())):
                    type(2)
                    init(0 100 0 0 319 0 319 98 291 102 270 93 271 105 187 117 51 117)
                    yourself()
                )
))
            = local91[0] @local17
            (egoTell:init(gOwner @local17 @local91))
            = local118[0] @local66
            (junkTell:init(aSanford @local66 @local118))
            = local108[0] @local85
            (oilTell:init(aOilSeller @local85 @local108))
            = local103[0] @local50
            = local103[1] @local56
            = local103[2] @local56
            (weaponTell:init(aWeaponSeller @local50 @local103 @local63))
            = local113[0] @local72
            = local113[1] @local78
            (honeyTell:init(aHoneySeller @local72 @local113 @local82))
            (send gOwner:code(bazCode))
            (mooseHead:
                init()
                addToPic()
            )
            (if ((== global125 2) and not proc0_6(147))
                (blackBird:
                    init()
                    stopUpd()
                )
            )
            (spearsLeft:
                setPri(7)
                init()
                addToPic()
            )
            (spearsRight:
                setPri(8)
                init()
                addToPic()
            )
            (junkRight:
                setPri(0)
                init()
                addToPic()
            )
            (honeyOnShelf:
                setPri(11)
                init()
                addToPic()
            )
            (oilRug:
                setPri(0)
                init()
                addToPic()
            )
            (oilBottles:
                setPri(14)
                init()
                addToPic()
            )
            = aWeaponSellerInit[0] (aWeaponSeller:init())
            (aSanford:
                init()
                stopUpd()
            )
            = aWeaponSellerInit[1] (aSon:init())
            = aWeaponSellerInit[2] (aHoneySeller:init())
            = aWeaponSellerInit[3] (aOilSeller:init())
            (aWeaponSeller:stopUpd())
            (aSon:stopUpd())
            (aHoneySeller:stopUpd())
            (aOilSeller:stopUpd())
            (leftoilbottles:init())
            (bigoilbottle:init())
            (rightoilbottles:init())
            (oilrug:init())
            (weapon_stand:init())
            (honeystand:init())
            (pansonrope:init())
            (leftjunk:init())
            (junkdealertent:init())
            (purplepot:init())
            (platerows:init())
            (righttable:init())
            (largeurns:init())
        )
        (super:init(rest param1))
        proc0_3()
        (switch (gGClientModNum)
            (case 230
                = style -32759
                (if (((< global122 5) and proc0_6(22)) and not proc0_6(36))
                    (send (ScriptID(241 0)):
                        init()
                        addToPic()
                    )
                    (send ((View:new())):
                        view(240)
                        loop(2)
                        cel(1)
                        x(146)
                        y(117)
                        init()
                        addToPic()
                    )
                    (aWeaponSeller:addToPic())
                    (aSon:addToPic())
                    (aHoneySeller:addToPic())
                    (aOilSeller:addToPic())
                    (aSanford:addToPic())
                    (self:setScript(thiefChase self))
                )(else
                    (self:setScript(from230))
                )
            )
            (case 250
                = style -32761
                (self:setScript(from250))
            )
            (case 270
                = style -32761
                (self:setScript(from270))
            )
            (default 
                (send gOwner:
                    x(35)
                    y(120)
                )
            )
        )
    )


    (method (dispose)
        = global451 global122
        proc0_5(113)
        (if (local5)
            (send local5:dispose())
        )
        (if (local6)
            (send local6:dispose())
        )
        (if (local7)
            (send local7:dispose())
        )
        (if (local8)
            (send local8:dispose())
        )
        (send gQg3Walkers:delete(self))
        UnLoad(143 240)
        proc958_0(0 47 241 245 246 247 248)
        (super:dispose())
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 1
                (send gQg3Messager:say(noun 1 0 
                    (if (global121)
                        0
                    )(else
                        1
                    )
))
            )
            (case 3
                (if (& local11 $2000)
                    (if ((send (ScriptID(241 0)):cycler) and (& local11 $1000))
                        = local11 (& local11 $efff)
                        (send (ScriptID(241 0)):setCycle(Beg))
                    )
                    (if (not proc0_6(113) and not local10)
                        = local10 1
                        (send gQg3Messager:say(9 6 93))
                    )
                )(else
                    (if ((self:script))
                        (self:script(0))
                        (aWeaponSeller:
                            setCycle(End)
                            setLoop(2)
                        )
                    )
                    (if ((CueObj:theVerb))
                        (CueObj:theVerb(0))
                    )
                    (if (aSanfordNoun)
                        (send gQg3Messager:say(aSanfordNoun 6 10 0 aSon))
                    )
                )
                (send gOwner:setMotion(PolyPath (send ((User:curEvent)):x) (send ((User:curEvent)):y) aWeaponSeller))
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )


    (method (cue)
        (if (== (send gLongSong2:number) 231)
            (send gLongSong:pause(0))
            (send gLongSong2:
                client(0)
                number(924)
                setLoop(-1)
                play(127)
            )
        )
    )

)
(instance haramiBeg of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                proc0_4(159)
                (switch (gGClientModNum)
                    (case 270
                        (send gOwner:setMotion(PolyPath 220 111 self))
                    )
                    (case 230
                        (send gOwner:setMotion(PolyPath 20 115 self))
                    )
                    (case 250
                        (send gOwner:setMotion(PolyPath 87 175 self))
                    )
                )
            )
            (case 1
                = cycles 5
            )
            (case 2
                (if (proc0_6(47))
                    proc0_4(172)
                    (send gQg3Messager:say(9 6 7 0 self))
                )(else
                    (if (proc0_6(46))
                        (send gQg3Messager:say(9 6 6 0 self))
                    )(else
                        (if (proc0_6(40))
                            (send gQg3Messager:say(9 6 75 0 self))
                        )(else
                            (send gQg3Messager:say(9 6 62 0 self))
                            proc0_4(40)
                        )
                    )
                )
            )
            (case 3
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance weaponSellerFirst of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (if ((aWeaponSeller:cycler))
                    = local0 1
                )
                (aWeaponSeller:setCycle(Beg self))
                (send gOwner:setMotion(0))
                (aSon:setCycle(0))
            )
            (case 1
                proc0_12(gOwner aWeaponSeller)
                = cycles (+ (send gOwner:cycleSpeed) 15)
            )
            (case 2
                (send gQg3Messager:say(1 6 1 1 self))
            )
            (case 3
                (aWeaponSeller:
                    setLoop(2)
                    cel(6)
                    setCycle(CT 3 -1 self)
                )
            )
            (case 4
                (send gQg3Messager:say(1 6 3 0 self))
            )
            (case 5
                (aWeaponSeller:
                    cel(0)
                    setCycle(End self)
                )
            )
            (case 6
                proc0_3()
                localproc_08de(1)
                proc0_4(106)
                (aWeaponSeller:stopUpd())
                = local0 1
                (self:dispose())
            )
        )
    )

)
(instance thiefChase of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:
                    x(-20)
                    y(110)
                    code(0)
                    setMotion(PolyPath 85 120 self)
                )
            )
            (case 1
                = cycles 5
            )
            (case 2
                (send gQg3Messager:say(8 6 47 0 self))
            )
            (case 3
                proc0_2()
                (send gLongSong2:fade())
                (send gLongSong3:fade())
                (send global2:newRoom(340))
            )
        )
    )

)
(instance aSonGreeting of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:setMotion(0))
                = cycles 5
            )
            (case 1
                proc0_12(gOwner aSanford)
                = cycles (+ (send gOwner:cycleSpeed) 15)
            )
            (case 2
                (aSanford:setCycle(End self))
            )
            (case 3
                (send gQg3Messager:say(7 6 62 0 self))
            )
            (case 4
                localproc_08de(7)
                (aSanford:setCycle(CT 0 -1 self))
            )
            (case 5
                proc0_3()
                (aSanford:stopUpd())
                (self:dispose())
            )
        )
    )

)
(instance from230 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:
                    x(-30)
                    y(70)
                )
                (send (ScriptID(241 0)):setLoop(0))
                = cycles 5
            )
            (case 1
                (if (& local11 $2000)
                    (if (proc0_6(47))
                        = local99[0] @local45
                        (haramiTell:init(ScriptID(241 0) @local45 @local99))
                        (send global2:setScript(haramiBeg))
                    )(else
                        (if (proc0_6(46))
                            = local11 (| local11 $0020)
                            = local99[0] @local40
                            (haramiTell:init(ScriptID(241 0) @local40 @local99))
                            (send global2:setScript(haramiBeg))
                        )(else
                            = local11 (| local11 $0010)
                            = local99[0] @local33
                            (haramiTell:init(ScriptID(241 0) @local33 @local99))
                            (send global2:setScript(haramiBeg))
                        )
                    )
                )
                (self:cue())
            )
            (case 2
                (send gOwner:setMotion(PolyPath 20 115 self))
            )
            (case 3
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance from250 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:
                    x(130)
                    y(250)
                )
                (send (ScriptID(241 0)):setLoop(0))
                = cycles 5
            )
            (case 1
                (if (& local11 $2000)
                    (if (proc0_6(47))
                        = local99[0] @local45
                        (haramiTell:init(ScriptID(241 0) @local45 @local99))
                        (send global2:setScript(haramiBeg))
                    )(else
                        (if (proc0_6(46))
                            = local11 (| local11 $0020)
                            = local99[0] @local40
                            (haramiTell:init(ScriptID(241 0) @local40 @local99))
                            (send global2:setScript(haramiBeg))
                        )(else
                            = local11 (| local11 $0010)
                            = local99[0] @local33
                            (haramiTell:init(ScriptID(241 0) @local33 @local99))
                            (send global2:setScript(haramiBeg))
                        )
                    )
                )
                (self:cue())
            )
            (case 2
                (send gOwner:setMotion(PolyPath 87 175 self))
            )
            (case 3
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance from270 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:
                    x(330)
                    y(120)
                )
                = cycles 5
            )
            (case 1
                (if (& local11 $2000)
                    (if (proc0_6(47))
                        = local99[0] @local45
                        (haramiTell:init(ScriptID(241 0) @local45 @local99))
                        (send global2:setScript(haramiBeg))
                    )(else
                        (if (proc0_6(46))
                            = local11 (| local11 $0020)
                            = local99[0] @local40
                            (haramiTell:init(ScriptID(241 0) @local40 @local99))
                            (send global2:setScript(haramiBeg))
                        )(else
                            = local11 (| local11 $0010)
                            = local99[0] @local33
                            (haramiTell:init(ScriptID(241 0) @local33 @local99))
                            (send global2:setScript(haramiBeg))
                        )
                    )
                )
                (self:cue())
            )
            (case 2
                (send gOwner:setMotion(PolyPath 300 115 self))
            )
            (case 3
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance begSecond of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gOwner:setMotion(0))
                proc0_12(gOwner ScriptID(241 0))
                = cycles (+ (send gOwner:cycleSpeed) 15)
            )
            (case 1
                (send gQg3Messager:say(9 6 92 0 self))
            )
            (case 2
                (self:dispose())
            )
        )
    )

)
(instance sExit of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (if (<= (send gOwner:x) 5)
                    = register 230
                    (send gOwner:setMotion(PolyPath -30 (send gOwner:y) self))
                )(else
                    (if (<= (send gOwner:y) 5)
                        = register 230
                        (send gOwner:setMotion(PolyPath (send gOwner:x) -30 self))
                    )(else
                        (if (>= (send gOwner:x) 315)
                            (if ((global121 and not proc0_6(113)) and (& local11 $2000))
                                (send gOwner:addHonor(-50))
                            )
                            = register 270
                            (send gLongSong:fade())
                            (send gLongSong2:fade())
                            (send gOwner:setMotion(PolyPath 340 (send gOwner:y) self))
                        )(else
                            (if (>= (send gOwner:y) 183)
                                = register 250
                                (send gOwner:setMotion(PolyPath (send gOwner:x) 240 self))
                            )
                        )
                    )
                )
            )
            (case 1
                (send global2:newRoom(register))
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance bazCode of Code
    (properties)

    (method (doit)
        (if (local0)
            localproc_0892()
        )
        (if ((send global2:script))
            0
        )(else
            (if (not 
            (if (< 5 (send gOwner:x))
                < (send gOwner:x) 315
            )
)
                (send global2:setScript(sExit))
            )(else
                (if (not 
                (if (< 5 (send gOwner:y))
                    < (send gOwner:y) 183
                )
)
                    (send global2:setScript(sExit))
                )(else
                    (if (< (send gOwner:distanceTo(aWeaponSeller)) 45)
                        (aWeaponSeller:setCycle(0))
                        (if (not proc0_6(106) and not local16)
                            = local16 1
                            (aWeaponSeller:setCycle(0))
                            (send global2:setScript(weaponSellerFirst))
                        )
                    )(else
                        (if (< (send gOwner:distanceTo(aSanford)) 25)
                            (if (<> (send gLongSong2:number) 231)
                                (send gLongSong:pause(1))
                                (send gLongSong2:
                                    client(0)
                                    number(231)
                                    setLoop(-1)
                                    play()
                                )
                            )
                            (if (not proc0_6(107))
                                proc0_4(107)
                                (send global2:setScript(aSonGreeting))
                            )(else
                                (if (not & local11 $0001)
                                    = local11 (| local11 $0001)
                                    = aSanfordNoun (aSanford:noun)
                                    (send gOwner:setMotion(0))
                                    (aSanford:newGreeting())
                                )
                            )
                        )(else
                            (if (< (send gOwner:distanceTo(aHoneySeller)) 40)
                                (aHoneySeller:setCycle(0))
                                (if (not & local11 $0002)
                                    = local11 (| local11 $0002)
                                    (send gOwner:setMotion(0))
                                    = aSanfordNoun (aHoneySeller:noun)
                                    (aHoneySeller:newGreeting())
                                )
                            )(else
                                (if (< (send gOwner:distanceTo(aSon)) 17)
                                    (if (<> (send gLongSong2:number) 231)
                                        (send gLongSong:pause(1))
                                        (send gLongSong2:
                                            client(0)
                                            number(231)
                                            setLoop(-1)
                                            play()
                                        )
                                    )
                                    (if (not proc0_6(107))
                                        proc0_4(107)
                                        (send global2:setScript(aSonGreeting))
                                    )(else
                                        (if (not & local11 $0004)
                                            = local11 (| local11 $0004)
                                            (send gOwner:setMotion(0))
                                            = aSanfordNoun (aSanford:noun)
                                            (aSanford:newGreeting())
                                        )
                                    )
                                )(else
                                    (if (< (send gOwner:distanceTo(aOilSeller)) 33)
                                        (aOilSeller:setCycle(0))
                                        (if (not & local11 $0008)
                                            = local11 (| local11 $0008)
                                            (send gOwner:setMotion(0))
                                            = aSanfordNoun (aOilSeller:noun)
                                            (aOilSeller:newGreeting())
                                        )
                                    )(else
                                        (if ((== (send gLongSong2:number) 231) and (== (send gLongSong2:client) 0))
                                            (send gLongSong2:fade(60 5 5 0 global2))
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance nightCode of Code
    (properties)

    (method (doit)
        (if ((send global2:script))
            0
        )(else
            (if (not 
            (if (< 5 (send gOwner:x))
                < (send gOwner:x) 315
            )
)
                (send global2:setScript(sExit))
            )(else
                (if (not 
                (if (< 5 (send gOwner:y))
                    < (send gOwner:y) 183
                )
)
                    (send global2:setScript(sExit))
                )(else
                    (if (< (send gOwner:distanceTo(ScriptID(241 0))) 30)
                        (if (& local11 $0100)
                            0
                        )(else
                            = local11 (| local11 $0100)
                            (send (ScriptID(241 0)):setCycle(Fwd))
                            = local11 (| local11 $1000)
                            = local10 0
                            (send global2:setScript(begSecond))
                        )
                    )
                )
            )
        )
    )

)
(instance nightCodeX of Code
    (properties)

    (method (doit)
        (if ((send global2:script))
            0
        )(else
            (if (not 
            (if (< 5 (send gOwner:x))
                < (send gOwner:x) 315
            )
)
                (send global2:setScript(sExit))
            )(else
                (if (not 
                (if (< 5 (send gOwner:y))
                    < (send gOwner:y) 183
                )
)
                    (send global2:setScript(sExit))
                )
            )
        )
    )

)
(instance public aWeaponSeller of MerchantActor
    (properties
        x 62
        y 82
        noun 1
        approachDist 50
        view 325
        loop 2
        signal $4000
        cycleSpeed 12
    )

    (method (init param1)
        (super:init(rest param1))
        (self:approachVerbs(2 4 59 10))
        return self
    )


    (method (dispose)
        (self:actions(0))
        (super:dispose())
    )


    (method (cue)
        (if (& local11 $0100)
            = local11 (& local11 $feff)
        )
    )


    (method (newGreeting)
        (switch (% global122 6)
            (case 0
                (send gQg3Messager:say(noun 6 4 0 aSon))
            )
            (case 1
                (send gQg3Messager:say(noun 6 5 0 aSon))
            )
            (case 2
                (send gQg3Messager:say(noun 6 6 0 aSon))
            )
            (case 3
                (send gQg3Messager:say(noun 6 7 0 aSon))
            )
            (case 4
                (send gQg3Messager:say(noun 6 8 0 aSon))
            )
            (case 5
                (send gQg3Messager:say(noun 6 9 0 aSon))
            )
        )
    )

)
(instance public aSanford of MerchantActor
    (properties
        x 241
        y 85
        noun 7
        approachDist 50
        view 242
        signal $5000
        cycleSpeed 19
    )

    (method (init param1)
        (super:init(rest param1))
        (self:approachVerbs(2 4 59 10))
    )


    (method (dispose)
        (self:actions(0))
        (super:dispose())
    )


    (method (newGreeting)
        (switch (% global122 6)
            (case 0
                (send gQg3Messager:say(noun 6 4 0 aSon))
            )
            (case 1
                (send gQg3Messager:say(noun 6 5 0 aSon))
            )
            (case 2
                (send gQg3Messager:say(noun 6 6 0 aSon))
            )
            (case 3
                (send gQg3Messager:say(noun 6 7 0 aSon))
            )
            (case 4
                (send gQg3Messager:say(noun 6 8 0 aSon))
            )
            (case 5
                (send gQg3Messager:say(noun 6 9 0 aSon))
            )
        )
    )

)
(instance public aSon of MerchantActor
    (properties
        x 209
        y 104
        noun 6
        approachDist 40
        view 244
        loop 2
        signal $4000
        cycleSpeed 11
    )

    (method (init param1)
        (super:init(rest param1))
        (self:approachVerbs(2 4 59 10))
        return self
    )


    (method (dispose)
        (self:actions(0))
        (super:dispose())
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 1
                (super:doVerb(theVerb))
            )
            (default 
                (junkTell:doVerb(theVerb))
            )
        )
    )


    (method (cue)
        localproc_08de(aSanfordNoun)
        = aSanfordNoun 0
    )

)
(instance public aHoneySeller of MerchantActor
    (properties
        x 304
        y 167
        noun 4
        approachDist 30
        view 254
        priority 11
        signal $4010
        cycleSpeed 14
    )

    (method (init param1)
        (super:init(rest param1))
        (self:approachVerbs(2 4 59 10))
        return self
    )


    (method (dispose)
        (self:actions(0))
        (super:dispose())
    )


    (method (newGreeting)
        (switch (% global122 6)
            (case 0
                (send gQg3Messager:say(noun 6 4 0 aSon))
            )
            (case 1
                (send gQg3Messager:say(noun 6 5 0 aSon))
            )
            (case 2
                (send gQg3Messager:say(noun 6 6 0 aSon))
            )
            (case 3
                (send gQg3Messager:say(noun 6 7 0 aSon))
            )
            (case 4
                (send gQg3Messager:say(noun 6 8 0 aSon))
            )
            (case 5
                (send gQg3Messager:say(noun 6 9 0 aSon))
            )
        )
    )

)
(instance public aOilSeller of MerchantActor
    (properties
        x 197
        y 182
        noun 5
        approachDist 30
        view 258
        loop 2
        priority 15
        signal $4000
        cycleSpeed 11
    )

    (method (init param1)
        (super:init(rest param1))
        (self:approachVerbs(2 4 59 10))
        return self
    )


    (method (dispose)
        (self:actions(0))
        (super:dispose())
    )


    (method (cue)
        (send aWeaponSellerInit[local3]:stopUpd())
        = local0 1
    )


    (method (newGreeting)
        (switch (% global122 6)
            (case 0
                (send gQg3Messager:say(noun 6 4 0 aSon))
            )
            (case 1
                (send gQg3Messager:say(noun 6 5 0 aSon))
            )
            (case 2
                (send gQg3Messager:say(noun 6 6 0 aSon))
            )
            (case 3
                (send gQg3Messager:say(noun 6 7 0 aSon))
            )
            (case 4
                (send gQg3Messager:say(noun 6 8 0 aSon))
            )
            (case 5
                (send gQg3Messager:say(noun 6 9 0 aSon))
            )
        )
    )

)
(instance egoTell of Teller
    (properties)

    (method (respond)
        return 
            (if (not local4)
                (super:respond())
            )(else
                = local4 0
                (if (not query)
                    return 1
                )(else
                    (if (== query -999)
                        return 1
                    )(else
                        (if (== query 999)
                            (self:doParent())
                            return 0
                        )(else
                            (if ((< query 0) and not (self:doChild(query)))
                                return 1
                            )
                        )
                    )
                )
                (if (< query 0)
                    = query neg query
                )
                (send gQg3Messager:say((send client:noun) 5 query 0))
                return 1
            )
    )


    (method (showDialog)
        (var temp0)
        = local9 proc51_1()
        = temp0 (send gOwner:distanceTo(local9))
        (switch (local9)
            (case aWeaponSeller
                (if (> temp0 45)
                    (send gQg3Messager:say(3 6 99))
                    return -999
                )
            )
            (case aOilSeller
                (if (> temp0 48)
                    (send gQg3Messager:say(3 6 99))
                    return -999
                )
            )
            (case aSon
                (if (> temp0 18)
                    (send gQg3Messager:say(3 6 99))
                    return -999
                )
            )
            (case aHoneySeller
                (if (> temp0 41)
                    (send gQg3Messager:say(3 6 99))
                    return -999
                )
            )
            (default 
                (if (> temp0 26)
                    (send gQg3Messager:say(3 6 99))
                    return -999
                )(else
                    (if (<> (send gLongSong2:number) 231)
                        (send gLongSong:pause(1))
                        (send gLongSong2:
                            client(0)
                            number(231)
                            setLoop(-1)
                            play()
                        )
                    )
                )
            )
        )
        (if (<> (send gOwner:heading) GetAngle((send gOwner:x) (send gOwner:y) (send local9:x) (send local9:y)))
            proc0_12(gOwner local9)
        )
        (send ((Timer:new())):setCycle(self (+ (send gOwner:cycleSpeed) 10)))
        = iconValue 0
        return -999
    )


    (method (doChild)
        return 
            (switch (query)
                (case -92
                    (if (== local9 aWeaponSeller)
                        = query 41
                    )(else
                        (if (== local9 aSon)
                            = query 73
                        )(else
                            (if (== local9 aSanford)
                                = query 73
                            )(else
                                (if (== local9 aHoneySeller)
                                    = query 50
                                )(else
                                    (if (== local9 aOilSeller)
                                        = query 59
                                    )
                                )
                            )
                        )
                    )
                )
                (case -93
                    (if (== local9 aWeaponSeller)
                        = query 42
                    )(else
                        (if (== local9 aSon)
                            = query 74
                        )(else
                            (if (== local9 aSanford)
                                = query 74
                            )(else
                                (if (== local9 aHoneySeller)
                                    = query 51
                                )(else
                                    (if (== local9 aOilSeller)
                                        = query 60
                                    )
                                )
                            )
                        )
                    )
                )
                (case -105
                    (if (== local9 aWeaponSeller)
                        = query 87
                    )(else
                        (if (== local9 aSon)
                            = query 88
                        )(else
                            (if (== local9 aSanford)
                                = query 88
                            )(else
                                (if (== local9 aHoneySeller)
                                    = query 89
                                )(else
                                    (if (== local9 aOilSeller)
                                        = query 90
                                    )
                                )
                            )
                        )
                    )
                )
                (case -43
                    (if (== (send ((send gInv:at(0))):message) 59)
                        (send gQg3Messager:say(1 6 94))
                    )(else
                        (weaponTell:doVerb(10))
                    )
                    return 0
                )
                (case -72
                    (if (== (send ((send gInv:at(0))):message) 59)
                        (send gQg3Messager:say(7 6 94))
                    )(else
                        (if (((send gOwner:has(9)) and (<> global125 2)) or (((== global125 2) and (send gOwner:has(9))) and (send gOwner:has(33))))
                            (send gQg3Messager:say(3 6 115))
                        )(else
                            (junkTell:doVerb(10))
                        )
                    )
                    return 0
                )
                (case -97
                    (if (== (send ((send gInv:at(0))):message) 59)
                        (send gQg3Messager:say(4 6 94))
                    )(else
                        (if ((send gOwner:has(29)))
                            (send gQg3Messager:say(3 6 113))
                        )(else
                            (honeyTell:doVerb(10))
                        )
                    )
                    return 0
                )
                (case -98
                    (if (== (send ((send gInv:at(0))):message) 59)
                        (send gQg3Messager:say(5 6 94))
                    )(else
                        (if ((send gOwner:has(25)))
                            (send gQg3Messager:say(3 6 114))
                        )(else
                            (oilTell:doVerb(10))
                        )
                    )
                    return 0
                )
            )
    )


    (method (cue)
        = query (super:showDialog(-105 (== global125 2) -97 (== aHoneySeller local9) -72 
                (if (== aSanford local9)
                )(else
                    (== aSon local9)
                )
 -43 (== aWeaponSeller local9) -98 (== aOilSeller local9)))
        = local4 1
        (if (iconValue)
            = query iconValue
        )
        (egoTell:respond())
    )

)
(instance nightTell of Teller
    (properties)

    (method (showDialog)
        (super:showDialog(84 
            (if (proc0_6(46))
            )(else
                proc0_6(47)
            )
 -86 proc0_6(47) -85 (== global125 2)))
    )


    (method (doChild)
        return 
            (switch (query)
                (case -86
                    (send gOwner:solvePuzzle(221 8))
                    return query
                )
                (case -85
                    (send gOwner:solvePuzzle(229 8))
                    return query
                )
            )
    )

)
(instance weaponTell of Teller
    (properties)

    (method (doChild)
        (switch (query)
            (case -100
                (switch (% global122 6)
                    (case 0
                        = query 23
                    )
                    (case 1
                        = query 24
                    )
                    (case 2
                        = query 25
                    )
                    (case 3
                        = query 26
                    )
                    (case 4
                        = query 27
                    )
                    (case 5
                        = query 28
                    )
                )
            )
            (case -101
                (switch (% global122 6)
                    (case 0
                        = query 29
                    )
                    (case 1
                        = query 30
                    )
                    (case 2
                        = query 31
                    )
                    (case 3
                        = query 32
                    )
                    (case 4
                        = query 33
                    )
                    (case 5
                        = query 34
                    )
                )
            )
            (default 
                (super:doChild(query))
            )
        )
    )


    (method (doVerb theVerb)
        (if (<> local2 1)
            localproc_08de(local2)
            = local2 1
        )
        return 
            (switch (theVerb)
                (case 59
                    = aSanfordNoun 1
                    (send gQg3Messager:say(1 6 94 0 aSon))
                )
                (case 10
                    (if (not local5)
                        (send (ScriptID(245 1)):goods((send ((List:new())):add((send ((Class_47_1:new(29))):
                                    price(15)
                                    quantity(
                                        (if (proc0_6(166))
                                            0
                                        )(else
                                            1
                                        )
)
                                )
 (send ((Class_47_1:new(30))):
                                    price(6)
                                    quantity(26)
                                )
 (send ((Class_47_1:new(31))):
                                    price(15)
                                    quantity(
                                        (if (proc0_6(167))
                                            0
                                        )(else
                                            1
                                        )
)
                                )
))))
                        = local5 (send (ScriptID(245 1)):goods)
                    )(else
                        (send (ScriptID(245 1)):goods(local5))
                    )
                    (send (ScriptID(245 1)):
                        init()
                        purchase()
                        dispose()
                    )
                    return 1
                )
                (default 
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance junkTell of Teller
    (properties)

    (method (doChild)
        (switch (query)
            (case -100
                (switch (% global122 6)
                    (case 0
                        = query 23
                    )
                    (case 1
                        = query 24
                    )
                    (case 2
                        = query 25
                    )
                    (case 3
                        = query 26
                    )
                    (case 4
                        = query 27
                    )
                    (case 5
                        = query 28
                    )
                )
            )
            (case -101
                (switch (% global122 6)
                    (case 0
                        = query 64
                    )
                    (case 1
                        = query 65
                    )
                    (case 2
                        = query 66
                    )
                    (case 3
                        = query 67
                    )
                    (case 4
                        = query 68
                    )
                    (case 5
                        = query 69
                    )
                )
            )
        )
    )


    (method (doVerb theVerb)
        (if (<> local2 7)
            localproc_08de(local2)
            = local2 7
        )
        return 
            (switch (theVerb)
                (case 59
                    = aSanfordNoun 7
                    (send gQg3Messager:say(6 6 94 0 aSon))
                )
                (case 10
                    (if (((send gOwner:has(9)) and (<> global125 2)) or (((== global125 2) and (send gOwner:has(9))) and (send gOwner:has(33))))
                        (send gQg3Messager:say(3 6 115))
                    )(else
                        (if (not local6)
                            (send (ScriptID(246 2)):goods((send ((List:new())):add((send ((Class_47_1:new(27))):
                                        price(200)
                                        denomination(1)
                                        quantity(
                                            (if ((send gOwner:has(9)))
                                                0
                                            )(else
                                                1
                                            )
)
                                    )
 (send ((Class_47_1:new(28))):
                                        price(40)
                                        denomination(1)
                                        quantity(
                                            (if ((== global125 2) and not proc0_6(147))
                                                1
                                            )(else
                                                0
                                            )
)
                                    )
))))
                            = local6 (send (ScriptID(246 2)):goods)
                        )(else
                            (send (ScriptID(246 2)):goods(local6))
                        )
                        (send (ScriptID(246 2)):
                            init()
                            purchase()
                            dispose()
                        )
                        (if ((== global125 2) and proc0_6(147))
                            (blackBird:dispose())
                        )
                        return 1
                    )
                )
                (default 
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance honeyTell of Teller
    (properties)

    (method (doChild)
        return 
            (switch (query)
                (case -91
                    proc0_4(83)
                    return query
                )
                (case -100
                    (switch (% global122 6)
                        (case 0
                            = query 23
                        )
                        (case 1
                            = query 24
                        )
                        (case 2
                            = query 25
                        )
                        (case 3
                            = query 26
                        )
                        (case 4
                            = query 27
                        )
                        (case 5
                            = query 28
                        )
                    )
                )
                (case -101
                    (switch (% global122 6)
                        (case 0
                            = query 29
                        )
                        (case 1
                            = query 30
                        )
                        (case 2
                            = query 31
                        )
                        (case 3
                            = query 32
                        )
                        (case 4
                            = query 33
                        )
                        (case 5
                            = query 34
                        )
                    )
                )
                (default 
                    (super:doChild(query))
                )
            )
    )


    (method (doVerb theVerb)
        (if (<> local2 4)
            localproc_08de(local2)
            = local2 4
        )
        return 
            (switch (theVerb)
                (case 59
                    = aSanfordNoun 4
                    (send gQg3Messager:say(4 6 94 0 aSon))
                )
                (case 10
                    (if ((send gOwner:has(29)))
                        (send gQg3Messager:say(3 6 113))
                    )(else
                        (if (not local7)
                            (send (ScriptID(247 1)):goods((send ((List:new())):add((send ((Class_47_1:new(4))):
                                        price(80)
                                        denomination(1)
                                        quantity(
                                            (if ((send gOwner:has(29)))
                                                0
                                            )(else
                                                1
                                            )
)
                                    )
))))
                            = local7 (send (ScriptID(247 1)):goods)
                        )(else
                            (send (ScriptID(247 1)):goods(local7))
                        )
                        (send (ScriptID(247 1)):
                            init()
                            purchase()
                            dispose()
                        )
                    )
                    return 1
                )
                (default 
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance oilTell of Teller
    (properties)

    (method (doChild)
        (switch (query)
            (case -100
                (switch (% global122 6)
                    (case 0
                        = query 23
                    )
                    (case 1
                        = query 24
                    )
                    (case 2
                        = query 25
                    )
                    (case 3
                        = query 26
                    )
                    (case 4
                        = query 27
                    )
                    (case 5
                        = query 28
                    )
                )
            )
            (case -101
                (switch (% global122 6)
                    (case 0
                        = query 53
                    )
                    (case 1
                        = query 54
                    )
                    (case 2
                        = query 55
                    )
                    (case 3
                        = query 56
                    )
                    (case 4
                        = query 57
                    )
                    (case 5
                        = query 58
                    )
                )
            )
        )
    )


    (method (doVerb theVerb)
        (if (<> local2 5)
            localproc_08de(local2)
            = local2 5
        )
        return 
            (switch (theVerb)
                (case 59
                    = aSanfordNoun 5
                    (send gQg3Messager:say(5 6 94 0 aSon))
                )
                (case 10
                    (if ((send gOwner:has(25)))
                        (send gQg3Messager:say(3 6 114))
                    )(else
                        (if (not local8)
                            (send (ScriptID(248 1)):goods((send ((List:new())):add((send ((Class_47_1:new(5))):
                                        price(100)
                                        denomination(1)
                                        quantity(
                                            (if ((send gOwner:has(25)))
                                                0
                                            )(else
                                                1
                                            )
)
                                    )
))))
                            = local8 (send (ScriptID(248 1)):goods)
                        )(else
                            (send (ScriptID(248 1)):goods(local8))
                        )
                        (send (ScriptID(248 1)):
                            init()
                            purchase()
                            dispose()
                        )
                        return 1
                    )
                )
                (default 
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance spearsLeft of View
    (properties
        x 31
        y 78
        noun 11
        view 240
        signal $5000
    )
)
(instance spearsRight of View
    (properties
        x 88
        y 98
        view 240
        cel 1
        signal $5000
    )

    (method (doVerb theVerb)
        (weapon_stand:doVerb(theVerb))
    )

)
(instance junkRight of View
    (properties
        x 119
        y 41
        view 240
        cel 2
        signal $4000
    )

    (method (doVerb theVerb)
        (junktable:doVerb(theVerb))
    )

)
(instance mooseHead of View
    (properties
        x 113
        y 80
        noun 33
        view 240
        loop 2
        signal $4000
    )
)
(instance blackBird of Prop
    (properties
        x 222
        y 76
        noun 28
        view 241
        priority 6
        signal $0010
    )
)
(instance honeyOnShelf of View
    (properties
        x 287
        y 143
        view 240
        loop 1
        signal $4000
    )

    (method (doVerb theVerb)
        (honeystand:doVerb(theVerb))
    )

)
(instance oilRug of View
    (properties
        x 117
        y 154
        view 240
        loop 1
        cel 1
        signal $4000
    )
)
(instance oilBottles of View
    (properties
        x 228
        y 170
        view 240
        loop 1
        cel 2
        signal $4000
    )

    (method (doVerb theVerb)
        (rightoilbottles:doVerb(theVerb))
    )

)
(instance haramiTell of Teller
    (properties)

    (method (doVerb theVerb)
        (var temp0)
        (if (proc999_5(theVerb 27 29 40 28 24))
            = temp0 
                (switch (theVerb)
                    (case 24
                        14
                    )
                    (case 29
                        19
                    )
                    (case 40
                        29
                    )
                    (case 28
                        18
                    )
                    (case 27
                        17
                    )
                )
            (send gOwner:drop(temp0 1))
            proc0_4(113)
            (send gOwner:addHonor(10))
            (if ((send (ScriptID(241 0)):cycler))
                (send (ScriptID(241 0)):setCycle(Beg))
            )
            (send gQg3Messager:say(9 6 10))
        )(else
            (if (proc999_5(theVerb 59 10))
                (send gOwner:addHonor(5))
                (if ((send (ScriptID(241 0)):cycler))
                    (send (ScriptID(241 0)):setCycle(Beg))
                )
                (send gQg3Messager:say(9 6 112))
            )(else
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance leftoilbottles of Feature
    (properties
        x 148
        y 199
        z 30
        noun 12
        nsTop 164
        nsLeft 138
        nsBottom 175
        nsRight 158
    )
)
(instance bigoilbottle of Feature
    (properties
        x 160
        y 183
        noun 13
        nsTop 177
        nsLeft 153
        nsBottom 189
        nsRight 167
    )
)
(instance rightoilbottles of Feature
    (properties
        x 228
        y 193
        z 30
        noun 14
        nsTop 157
        nsLeft 222
        nsBottom 169
        nsRight 234
    )
)
(instance oilrug of Feature
    (properties
        x 189
        y 175
        noun 15
        nsTop 162
        nsLeft 124
        nsBottom 189
        nsRight 254
    )
)
(instance weapon_stand of Feature
    (properties
        x 72
        y 73
        noun 16
        nsTop 48
        nsLeft 34
        nsBottom 99
        nsRight 111
    )
)
(instance honeystand of Feature
    (properties
        x 290
        y 128
        noun 17
        nsTop 98
        nsLeft 262
        nsBottom 159
        nsRight 319
    )
)
(instance pansonrope of Feature
    (properties
        x 153
        y 66
        noun 24
        nsTop 50
        nsLeft 116
        nsBottom 82
        nsRight 191
    )
)
(instance leftjunk of Feature
    (properties
        x 165
        y 95
        noun 19
        nsTop 83
        nsLeft 146
        nsBottom 107
        nsRight 185
    )
)
(instance junktable of Feature
    (properties
        x 238
        y 86
        noun 20
        nsTop 75
        nsLeft 220
        nsBottom 98
        nsRight 257
    )
)
(instance junkdealertent of Feature
    (properties
        x 199
        y 52
        noun 18
        nsTop 17
        nsLeft 109
        nsBottom 87
        nsRight 289
    )
)
(instance purplepot of Feature
    (properties
        x 253
        y 63
        noun 25
        nsTop 52
        nsLeft 247
        nsBottom 74
        nsRight 260
    )
)
(instance platerows of Feature
    (properties
        x 270
        y 53
        noun 21
        nsTop 44
        nsLeft 261
        nsBottom 63
        nsRight 279
    )
)
(instance righttable of Feature
    (properties
        x 275
        y 69
        noun 22
        nsTop 63
        nsLeft 262
        nsBottom 75
        nsRight 289
    )
)
(instance largeurns of Feature
    (properties
        x 304
        y 77
        noun 23
        nsTop 64
        nsLeft 290
        nsBottom 90
        nsRight 319
    )
)
