(version 2)
(include "sci.sh")
(exports
    0 rm620
)
(use "Main")
(use "TellerIcon")
(use "CueObj")
(use "ForwardCounter")
(use "n958")
(use "Rev")
(use "Cycle")
(use "Game")
(use "View")
(use "Obj")
(script 620)


(local
    local0
    local1
    local2
    local3
    local4
    local5
    local6
    newView
    local8
    local9[12] = (0 -8 -4 -9 -2 -3 -1 -10 -11 -12 -14 999 )
    local21[3]
    local24[8] = (0 -4 -3 -6 -7 -5 -13 999 )
    local32[2]
    local34[8] = (0 -1 -2 -3 -4 -5 -13 999 )
    local42[2]
    local44[9] = (0 -10 -4 -3 -6 7 -13 -5 999 )
    local53[5]
    local58[3] = (0 -5 999 )
    local61[2]

)
(procedure (localproc_1b51)
    (leaderTell:init(leader @local34 @local42))
    (egoTell:init(gOwner @local9 @local21))
    (shamanTell:init(shaman @local44 @local53))
    (johariTell:init(ScriptID(36 1) @local24 @local32))
    = newView (View:new())
    (send newView:
        view(620)
        loop(2)
        cel(0)
        x(43)
        y(111)
        signal(16384)
        noun(4)
        actions(leopManTell)
        init()
    )
    (leopManTell:init(newView @local58 @local61))
    (send ((View:new())):
        view(620)
        loop(2)
        cel(0)
        x(108)
        y(128)
        signal(16384)
        noun(4)
        actions(leopManTell)
        init()
    )
    (send ((View:new())):
        view(620)
        loop(2)
        cel(1)
        x(205)
        y(127)
        signal(16384)
        noun(4)
        actions(leopManTell)
        init()
    )
    (send ((View:new())):
        view(620)
        loop(2)
        cel(3)
        x(255)
        y(115)
        signal(16384)
        noun(4)
        actions(leopManTell)
        init()
    )
    (send ((View:new())):
        view(620)
        loop(2)
        cel(3)
        x(210)
        y(103)
        signal(16384)
        noun(4)
        actions(leopManTell)
        init()
    )
    (fire:
        init()
        setCycle(Fwd)
    )
    (send (ScriptID(36 1)):
        view(620)
        loop(4)
        x(170)
        y(98)
        cel(1)
        init()
        noun(2)
        signal(16384)
    )
    (send gOwner:
        x(188)
        y(107)
        loop(1)
        cel(0)
        setScale(140)
        noun(5)
        init()
        normalize()
    )
    (throne:init())
    (platform:init())
)


(procedure (localproc_1d42)
    (dancer1:
        setCel(0)
        setCycle(End)
    )
    (dancer2:
        setCel(0)
        setCycle(End)
    )
    (dancer3:
        setCel(0)
        setCycle(End)
    )
    (dancer4:
        setCel(0)
        setCycle(End)
    )
    (dancer7:
        setCel(0)
        setCycle(End)
    )
    (dancer8:
        setCel(0)
        setCycle(End)
    )
)


(procedure (localproc_1da9)
    (egoAndJohari:init())
    (drummer1:init())
    (drummer2:init())
    (drummer3:init())
    (dancer1:
        setCycle(Fwd)
        init()
    )
    (dancer2:
        setCycle(Fwd)
        init()
    )
    (dancer3:
        setCycle(Fwd)
        init()
    )
    (dancer4:
        setCycle(Fwd)
        init()
    )
    (dancer7:
        setCycle(Fwd)
        init()
    )
    (dancer8:
        setCycle(Fwd)
        init()
    )
)


(class Wcycler of Cycle
    (properties
        client 0
        caller 0
        cycleDir 1
        cycleCnt 0
        completed 0
        head 0
        tail 10
        flash 0
    )

    (method (init param1 param2 param3)
        (super:init(param1))
        (self:head(param2))
        (if (> param3 (send client:lastCel()))
            (self:tail((send client:lastCel())))
        )(else
            (self:tail(param3))
        )
    )


    (method (doit)
        (var wcyclerNextCel)
        (if (not flash)
            (send client:hide())
            = flash 1
        )(else
            = flash 0
            = wcyclerNextCel (self:nextCel())
            (if (> wcyclerNextCel (self:tail))
                (self:cycleDone())
            )(else
                (send client:show())
                (send client:cel(wcyclerNextCel))
            )
        )
    )


    (method (cycleDone)
        (send client:cel(head))
    )

)
(instance public rm620 of Rm
    (properties
        noun 11
        picture 620
        vanishingY -25
    )

    (method (init param1)
        = local42[0] @local34
        = local21[0] @local9
        = local32[0] @local24
        = local53[0] @local44
        = local61[0] @local58
        (if (== gGClientModNum 420)
            = local0 1
        )(else
            (if (== gGClientModNum 650)
                = local0 4
            )(else
                (if (not proc0_6(37))
                    = local0 0
                )(else
                    (if ((send gOwner:has(46)))
                        = local0 2
                    )(else
                        = local0 3
                    )
                )
            )
        )
        (switch (local0)
            (case 0
                proc958_0(128 620 621 622)
                localproc_1da9()
                proc0_4(37)
                (super:init(rest param1))
                (send global2:setScript(changeDance))
                (send gLongSong:
                    number(620)
                    setLoop(1)
                    play(self)
                )
            )
            (case 1
                (if (not proc0_6(165))
                    (shaman:
                        init()
                        noun(3)
                        stopUpd()
                    )
                )
                (leader:
                    init()
                    noun(1)
                )
                (if (<> global100 0)
                    (send gOwner:changeGait(0))
                )
                (send gLongSong:
                    number(480)
                    setLoop(1)
                    play()
                )
                localproc_1b51()
                (super:init(rest param1))
                (send global2:setScript(backTarna))
            )
            (case 2
                proc958_0(128 605 606 625 626)
                (shaman:
                    init()
                    noun(3)
                    stopUpd()
                )
                (leader:
                    init()
                    noun(1)
                )
                (if (<> global100 0)
                    (send gOwner:changeGait(0))
                )
                (send gLongSong:
                    number(480)
                    setLoop(-1)
                    play()
                )
                localproc_1b51()
                (super:init(rest param1))
                (send global2:setScript(enterWithDrum))
            )
            (case 3
                proc958_0(128 605 606 625 626)
                (leader:
                    init()
                    x(83)
                    y(94)
                    noun(1)
                )
                (effect:
                    init()
                    show()
                )
                localproc_1b51()
                (send gLongSong:
                    number(480)
                    setLoop(1)
                    play()
                )
                (super:init(rest param1))
                (send global2:setScript(muEnter))
            )
            (case 4
                proc958_0(128 605 606 625 626)
                (leader:
                    init()
                    x(83)
                    y(94)
                    signal(16384)
                    noun(1)
                )
                localproc_1b51()
                (send gLongSong:
                    number(480)
                    setLoop(1)
                    play()
                )
                (super:init(rest param1))
                (send global2:setScript(eventFour))
            )
        )
    )


    (method (dispose param1)
        UnLoad(128 605)
        UnLoad(128 606)
        UnLoad(128 625)
        UnLoad(128 626)
        UnLoad(128 620)
        UnLoad(128 621)
        UnLoad(128 622)
        proc958_0(0 36 44 43 956)
        (super:dispose(rest param1))
    )


    (method (cue)
        (switch ((send gLongSong:prevSignal))
            (case 20
                (drummer1:setCycle(End))
                (drummer2:setCycle(End))
                (drummer3:setCycle(End))
                = local8 1
                localproc_1d42()
            )
            (case 30
                = local8 0
                (drummer1:setCycle(Fwd))
                (drummer2:setCycle(Fwd))
                (drummer3:setCycle(Fwd))
            )
            (case -1
                (changeDance:cue())
                (send gLongSong:
                    number(622)
                    play()
                )
            )
            (case 10
                (if (local8)
                    localproc_1d42()
                )
            )
        )
    )

)
(instance backTarna of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                = cycles 5
            )
            (case 1
                (send gQg3Messager:say(2 6 49 0 self))
            )
            (case 2
                (send gOwner:
                    normalize()
                    setMotion(MoveTo + (leader:x) 24 107 self)
                    solvePuzzle(298 20)
                )
            )
            (case 3
                proc0_12(gOwner leader self)
            )
            (case 4
                = cycles 20
            )
            (case 5
                (send gOwner:
                    setCycle(Rev)
                    setLoop(1)
                    setMotion(MoveTo 138 107 self)
                )
            )
            (case 6
                (leader:
                    x(99)
                    y(99)
                    cel(0)
                    setLoop(0)
                    setCycle(End self)
                )
                (send gOwner:
                    setCycle(Walk)
                    setLoop(-1)
                    normalize()
                )
            )
            (case 7
                (leader:
                    cel(0)
                    setLoop(1)
                    setCycle(End self)
                )
            )
            (case 8
                (leader:
                    loop(2)
                    cel(0)
                    setCycle(CT 2 1 self)
                )
            )
            (case 9
                (send gQg3Messager:say(1 6 4 0 self))
            )
            (case 10
                = seconds 2
            )
            (case 11
                (leader:
                    cycleSpeed(12)
                    setCycle(CT 7 1 self)
                )
            )
            (case 12
                (leader:setCycle(CT 11 1 self))
            )
            (case 13
                (leader:
                    setLoop(3)
                    setCycle(End self)
                )
            )
            (case 14
                (send gQg3Messager:say(1 5 2 0 self))
            )
            (case 15
                (send gOwner:drop(46))
                = local3 1
                (send gOwner:addHonor(50))
                (send gQg3Messager:say(7 6 47 0 self))
            )
            (case 16
                (send gGQg3KDHandler:eachElementDo(102))
                DrawPic(0 dpCLOSEREOPEN_HCENTER)
                = seconds 1
            )
            (case 17
                = seconds 1
            )
            (case 18
                (send gQg3Messager:say(7 6 48 0 self))
            )
            (case 19
                (send global2:newRoom(340))
            )
        )
    )

)
(instance eventFour of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (fire:setPri((= cycles 10)))
            )
            (case 1
                (send gQg3Messager:say(1 2 14 0 self))
            )
            (case 2
                proc0_3(5 1 3 6)
                (self:dispose())
            )
        )
    )

)
(instance egoBows of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                = cycles 5
            )
            (case 1
                (if (== local0 3)
                    (self:changeState(4))
                )(else
                    (send gOwner:setMotion(MoveTo 139 105 self))
                )
            )
            (case 2
                proc0_12(gOwner leader self)
            )
            (case 3
                = cycles 5
            )
            (case 4
                (send gOwner:
                    view(32)
                    setLoop(1)
                    cycleSpeed(10)
                    setCycle(End self)
                )
            )
            (case 5
                (switch (register)
                    (case 1
                        (send gQg3Messager:say(5 6 19 0 self))
                    )
                    (case 2
                        (send gQg3Messager:say(5 6 16 0 self))
                    )
                    (case 3
                        (send gQg3Messager:say(5 6 31 0 self))
                    )
                    (case 4
                        (send gQg3Messager:say(5 6 44 0 self))
                    )
                )
            )
            (case 6
                (send gOwner:
                    setLoop(-1)
                    cycleSpeed(6)
                    normalize()
                    addHonor(5)
                )
                proc0_3(5 1 3 6)
                (self:dispose())
            )
        )
    )

)
(instance changeDance of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                = local8 1
                = seconds 2
            )
            (case 1
                (send gQg3Messager:say(2 2 10 0))
            )
            (case 2
                (dancer1:
                    loop(1)
                    cel(0)
                    setCycle(CT 3 1)
                )
                (dancer4:
                    loop(3)
                    cel(0)
                    setCycle(CT 2 1)
                )
                (dancer7:
                    loop(1)
                    cel(0)
                    setCycle(CT 3 1)
                )
                (dancer8:
                    loop(1)
                    cel(0)
                    setCycle(CT 3 1 self)
                )
                (dancer2:
                    loop(3)
                    cel(0)
                    setCycle(CT 2 1 self)
                )
                (dancer3:
                    loop(3)
                    cel(0)
                    setCycle(CT 2 1 self)
                )
            )
            (case 3
                (dancer1:setCycle(Wcycler 3 4))
                (dancer4:setCycle(Wcycler 2 3))
                (dancer7:setCycle(Wcycler 3 4))
                (dancer8:setCycle(Wcycler 3 4))
                (dancer2:setCycle(Wcycler 2 3))
                (dancer3:setCycle(Wcycler 2 3))
                = seconds 4
            )
            (case 4
                Palette(palSET_INTENSITY 0 255 1000)
                Palette(palSET_INTENSITY 0 255 100)
                (dancer1:
                    show()
                    setCycle(End)
                )
                (dancer4:
                    show()
                    setCycle(End)
                )
                (dancer7:
                    show()
                    setCycle(End)
                )
                (dancer8:
                    show()
                    setCycle(End)
                )
                (dancer2:
                    show()
                    setCycle(End)
                )
                (dancer3:
                    show()
                    setCycle(End)
                )
                = seconds 2
            )
            (case 5
                (send gQg3Messager:say(2 2 15 0 self))
            )
            (case 6
                (if (== global125 2)
                    (send global2:newRoom(630))
                )(else
                    (send global2:newRoom(600))
                )
            )
        )
    )

)
(instance muEnter of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (fire:setPri(10))
                = cycles 10
            )
            (case 1
                (send gQg3Messager:say(1 2 27 0 self))
            )
            (case 2
                (send gQg3Messager:say(2 2 28 0 self))
            )
            (case 3
                proc0_3(5 1 3 6)
                (self:dispose())
            )
        )
    )

)
(instance shamanEnters of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (effect:show())
                = cycles 5
            )
            (case 1
                (send gQg3Messager:say(5 5 10 0 self))
            )
            (case 2
                (send gLongSong2:
                    number(831)
                    play()
                    setLoop(-1)
                )
                (effect:
                    cycleSpeed(0)
                    setCycle(ForwardCounter 3 self)
                )
            )
            (case 3
                (shaman:
                    view(625)
                    loop(0)
                    cel(0)
                    x(138)
                    y(103)
                    priority(- (effect:priority) 1)
                    noun(3)
                    init()
                )
                (shamanTell:init(shaman @local44 @local53))
                (effect:setCycle(End self))
            )
            (case 4
                (effect:dispose())
                (shaman:setCycle(End self))
            )
            (case 5
                (shaman:
                    x(145)
                    y(101)
                    cel(0)
                    setLoop(1)
                    setCycle(CT 5 1 self)
                )
            )
            (case 6
                (send gQg3Messager:say(3 6 32 0 self))
            )
            (case 7
                (shaman:setCycle(CT 9 1 self))
            )
            (case 8
                (send gQg3Messager:say(2 2 33 0 self))
            )
            (case 9
                = local1 1
                = local2 0
                proc0_3(5 1 3 6)
                (self:dispose())
            )
        )
    )

)
(instance giveSpear of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:normalize())
                (switch (register)
                    (case 1
                        (send gOwner:addHonor(50))
                        (send gQg3Messager:say(5 6 41 0 self))
                    )
                    (case 2
                        (send gQg3Messager:say(5 5 43 0 self))
                    )
                    (case 3
                        (send gQg3Messager:say(5 6 22 0 self))
                    )
                    (case 5
                        (send gQg3Messager:say(5 6 23 0 self))
                    )
                    (default 
                        (send gQg3Messager:say(5 5 1 0 self))
                    )
                )
            )
            (case 1
                (if (local3)
                    (self:cue())
                )(else
                    (self:setScript(chiefStand self))
                )
            )
            (case 2
                (leader:
                    loop(4)
                    setCycle(Fwd)
                )
                (send gLongSong2:
                    number(12)
                    setLoop(1)
                    play(127 self)
                )
            )
            (case 3
                (leader:setCycle(0))
                (spear:init())
                = cycles 10
            )
            (case 4
                (if (== local0 4)
                    (send gOwner:setMotion(MoveTo 135 107 self))
                )(else
                    (self:cue())
                )
            )
            (case 5
                (send gOwner:
                    view(31)
                    cycleSpeed(12)
                    setLoop(1)
                    setCycle(Beg self)
                )
            )
            (case 6
                (spear:dispose())
                (send gOwner:
                    setLoop(-1)
                    cycleSpeed(6)
                    get(45)
                    normalize()
                )
                = cycles 2
            )
            (case 7
                (leader:
                    setLoop(1)
                    setCycle(CT 0 -1 self)
                )
            )
            (case 8
                (send gOwner:
                    view(13)
                    loop(0)
                    cel(0)
                    cycleSpeed(12)
                    setCycle(End self)
                )
            )
            (case 9
                = seconds 5
            )
            (case 10
                (send gGQg3KDHandler:eachElementDo(102))
                (send global2:drawPic(0))
                = seconds 2
            )
            (case 11
                (send gQg3Messager:say(7 2 17 0 self))
                (if (PalVary(pvGET_CURRENT_STEP))
                    proc0_5(81)
                    PalVary(pvREVERSE 1)
                )
            )
            (case 12
                (send gOwner:
                    cycleSpeed(6)
                    normalize()
                )
                (send (ScriptID(7 4)):init(10 0))
                = cycles 5
            )
            (case 13
                (send global2:newRoom(420))
            )
        )
    )

)
(instance chiefStand of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (leader:
                    x(99)
                    y(99)
                    loop(1)
                    setCycle(End self)
                )
            )
            (case 1
                = cycles 10
            )
            (case 2
                (self:dispose())
            )
        )
    )

)
(instance enterWithDrum of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (fire:setPri(10))
                = cycles 10
            )
            (case 1
                (send gQg3Messager:say(1 2 18 0 self))
            )
            (case 2
                (send gQg3Messager:say(3 6 18 0 self))
            )
            (case 3
                (send (ScriptID(36 1)):
                    view(620)
                    cel(2)
                    setLoop(4)
                    setScale(0)
                    setCycle(End self)
                )
            )
            (case 4
                (send gQg3Messager:say(2 2 20 0 self))
            )
            (case 5
                (send (ScriptID(36 1)):setCycle(CT 0 -1 self))
            )
            (case 6
                proc0_3(5 1 3 6)
                (self:dispose())
            )
        )
    )

)
(instance egoGiveDrum of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:
                    normalize()
                    setMotion(MoveTo + (leader:x) 24 107 self)
                    solvePuzzle(298 20)
                )
            )
            (case 1
                proc0_12(gOwner leader self)
            )
            (case 2
                = cycles 20
            )
            (case 3
                (send gOwner:
                    setCycle(Rev)
                    setLoop(1)
                    setMotion(MoveTo 138 107 self)
                )
            )
            (case 4
                (leader:
                    x(99)
                    y(99)
                    cel(0)
                    setLoop(0)
                    setCycle(End self)
                )
                (send gOwner:
                    setCycle(Walk)
                    setLoop(-1)
                    normalize()
                )
            )
            (case 5
                (leader:
                    cel(0)
                    setLoop(1)
                    setCycle(End self)
                )
            )
            (case 6
                (leader:
                    loop(2)
                    cel(0)
                    setCycle(CT 2 1 self)
                )
            )
            (case 7
                (send gQg3Messager:say(1 6 4 0 self))
            )
            (case 8
                = seconds 2
            )
            (case 9
                (leader:
                    cycleSpeed(12)
                    setCycle(CT 7 1 self)
                )
            )
            (case 10
                (leader:setCycle(CT 11 1 self))
            )
            (case 11
                (leader:
                    setLoop(3)
                    setCycle(End self)
                )
            )
            (case 12
                = local6 1
                (if ((send gOwner:has(45)) and (== global125 2))
                    (self:cue())
                )(else
                    (send gQg3Messager:say(2 6 4 0 self))
                )
            )
            (case 13
                (leader:cycleSpeed(6))
                proc0_4(13)
                = local3 1
                (send gOwner:addHonor(50))
                (if ((send gOwner:has(45)) and (== global125 2))
                    (self:cue())
                )(else
                    proc0_3(5 1 3 6)
                    (send gOwner:drop(46))
                    (self:dispose())
                )
            )
            (case 14
                (send gOwner:drop(46))
                (send gGQg3KDHandler:eachElementDo(102))
                (send global2:drawPic(0))
                = seconds 2
            )
            (case 15
                (send gQg3Messager:say(7 2 35 0 self))
            )
            (case 16
                (send gOwner:
                    cycleSpeed(6)
                    normalize()
                )
                (send global2:newRoom(420))
            )
        )
    )

)
(instance accept of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gQg3Messager:say(5 6 11 0 self))
            )
            (case 1
                (leader:
                    x(98)
                    y(98)
                    cel(0)
                    setLoop(1)
                    setCycle(End self)
                )
            )
            (case 2
                (send gQg3Messager:say(1 6 13 0 self))
            )
            (case 3
                (send global2:newRoom(650))
            )
        )
    )

)
(instance fire of Prop
    (properties
        x 149
        y 101
        noun 8
        view 620
        signal $4000
    )
)
(instance spear of View
    (properties
        x 135
        y 93
        view 620
        loop 1
        signal $4000
    )
)
(instance dancer1 of Prop
    (properties
        x 207
        y 104
        view 622
        loop 4
    )

    (method (doVerb theVerb param2)
        (switch (theVerb)
            (case 4
                (send global2:setScript(shamanEnters))
            )
            (case 2
                (leopManTell:client(dancer1))
            )
            (default 
                (super:doVerb(theVerb rest param2))
            )
        )
    )

)
(instance dancer2 of Prop
    (properties
        x 107
        y 130
        view 622
        loop 2
    )
)
(instance dancer3 of Prop
    (properties
        x 203
        y 130
        view 622
        loop 2
    )
)
(instance dancer4 of Prop
    (properties
        x 154
        y 136
        view 622
        loop 2
    )
)
(instance dancer7 of Prop
    (properties
        x 105
        y 101
        view 622
        loop 5
    )
)
(instance dancer8 of Prop
    (properties
        x 155
        y 101
        view 622
    )
)
(instance egoAndJohari of View
    (properties
        x 205
        y 139
        view 620
        loop 3
    )
)
(instance leader of Prop
    (properties
        x 83
        y 94
        view 605
    )
)
(instance shaman of Prop
    (properties
        x 74
        y 103
        view 625
    )
)
(instance drummer1 of Prop
    (properties
        x 67
        y 125
        view 621
        cel 1
    )
)
(instance drummer2 of Prop
    (properties
        x 52
        y 122
        view 621
        cel 2
    )
)
(instance drummer3 of Prop
    (properties
        x 46
        y 118
        view 621
        cel 3
    )
)
(instance effect of Prop
    (properties
        x 119
        y 89
        view 625
        loop 2
        signal $4000
    )
)
(instance egoTell of Teller
    (properties)

    (method (showDialog)
        (super:showDialog(-8 
            (if (not local2)
                not local3
            )(else
                0
            )
 -4 (== local0 2) -10 (== local0 3) -9 (== local1 0) -11 
            (if (== local0 3)
                (== local1 1)
            )(else
                0
            )
 -12 
            (if (== local0 3)
                (== local1 1)
            )(else
                0
            )
 -14 (== local0 4) -3 (== local0 4) -2 
            (if (== local1 0)
                not local4
            )(else
                0
            )
 -1 
            (if (== local0 2)
                not local5
            )(else
                0
            )
))
    )


    (method (doChild)
        return 
            (switch (query)
                (case -9
                    (if (== local0 2)
                        (if (local6)
                            (send gQg3Messager:say(5 6 36))
                        )(else
                            (send gQg3Messager:say(5 5 9))
                        )
                    )(else
                        (if (== local0 3)
                            (send gQg3Messager:say(5 5 40))
                        )(else
                            (if (== local0 4)
                                (send gQg3Messager:say(5 5 45))
                            )(else
                                (send gQg3Messager:say(5 5 9))
                            )
                        )
                    )
                    return 0
                )
                (case -11
                    (send gOwner:addHonor(20))
                    (send global2:setScript(accept))
                    return 0
                )
                (case -12
                    (send gOwner:addHonor(-20))
                    (send gQg3Messager:say(5 6 12))
                    return 0
                )
                (case -4
                    (if ((send gOwner:has(46)))
                        (send gQg3Messager:say(5 5 4))
                        (send global2:setScript(egoGiveDrum))
                        return 0
                    )(else
                        (if (== local3 1)
                            (send global2:setScript(giveSpear 0 3))
                            return 0
                        )
                    )
                    return query
                )
                (case -8
                    (if (== local0 4)
                        (send global2:setScript(egoBows 0 4))
                    )(else
                        (if (local1)
                            (send global2:setScript(egoBows 0 3))
                        )(else
                            (send global2:setScript(egoBows 0 1))
                        )
                    )
                    = local2 1
                    return 0
                )
                (case -1
                    (if ((send gOwner:has(46)))
                        (send gQg3Messager:say(5 6 46))
                        (send global2:setScript(egoGiveDrum))
                        return 0
                    )(else
                        (if (== local3 1)
                            (send gOwner:addHonor(30))
                            (send global2:setScript(giveSpear 0 5))
                            = local5 1
                            return 0
                        )
                    )
                    return query
                )
                (case -2
                    (if (== local0 4)
                        (send global2:setScript(giveSpear 0 1))
                        return 0
                    )(else
                        (if (== local3 1)
                            (send global2:setScript(giveSpear 0 1))
                            (send gOwner:addHonor(30))
                            = local4 1
                            return 0
                        )(else
                            (if (== local0 2)
                                (send gQg3Messager:say(5 5 2))
                                (send global2:setScript(egoGiveDrum))
                                return 0
                            )(else
                                (send gQg3Messager:say(5 6 30))
                                return 0
                            )
                        )
                    )
                )
                (case -3
                    (send global2:setScript(giveSpear 0 2))
                    return 0
                )
                (case -10
                    (if (not == local1 1)
                        (send global2:setScript(shamanEnters))
                    )(else
                        (send global2:setScript(accept))
                    )
                    return 0
                )
                (default 
                    return query
                )
            )
    )

)
(instance leaderTell of Teller
    (properties)

    (method (showDialog)
        (super:showDialog(-13 
            (if (== local0 3)
                (== local1 1)
            )(else
                0
            )
 -1 
            (if (== local0 4)
            )(else
                (== local0 2)
            )
 -2 
            (if (== local0 4)
            )(else
                (== local0 2)
            )
 -3 (== local0 4) -4 (== local0 2) -5 
            (if (not (== local0 2) and (== local0 3))
                not local1
            )(else
                0
            )
))
    )


    (method (doChild param1)
        return 
            (switch (param1)
                (case -1
                    (if (local6)
                        (send gQg3Messager:say(1 5 1))
                    )(else
                        (send gQg3Messager:say(1 5 42))
                    )
                    return 0
                )
                (case -2
                    (if (== local0 3)
                        (send gQg3Messager:say(1 5 39))
                    )(else
                        (if (== local0 4)
                            (send gQg3Messager:say(1 5 41))
                        )(else
                            (if (local6)
                                (send gQg3Messager:say(1 5 2))
                            )(else
                                (send gQg3Messager:say(1 5 41))
                            )
                        )
                    )
                    return 0
                )
                (case -5
                    (if (== local0 2)
                        (send gQg3Messager:say(1 5 26))
                    )(else
                        (send gQg3Messager:say(2 5 29))
                    )
                    return 0
                )
                (case -4
                    (send gQg3Messager:say(1 5 4))
                    return 0
                )
                (case -3
                    (if (== local3 1)
                        (send global2:setScript(giveSpear 0 2))
                        return 0
                    )
                    return query
                )
                (default 
                    return query
                )
            )
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 57
                (if (== local0 2)
                    (send global2:setScript(egoGiveDrum))
                )(else
                    (super:doVerb(theVerb))
                )
            )
            (case 20
                (send global2:doVerb(theVerb))
            )
            (case 33
                (send global2:doVerb(theVerb))
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance shamanTell of Teller
    (properties)

    (method (showDialog)
        (super:showDialog(-4 (== local0 2) -3 (== local0 2) -6 (== local0 2) -5 (== local0 2) -10 (== local0 3) -7 (== local0 3) -13 (== local0 3)))
    )


    (method (doChild)
        return 
            (if ((== local0 2) or (== local0 3))
                (if (== local3 1)
                    (send gQg3Messager:say(0 5 21))
                )(else
                    (send gQg3Messager:say(0 5 34))
                )
                return 0
            )(else
                return query
            )
    )

)
(instance leopManTell of Teller
    (properties)

    (method (doChild)
        return 
            (if (== local0 2)
                (if (== local3 1)
                    (send gQg3Messager:say(0 5 21))
                )(else
                    (send gQg3Messager:say(0 5 34))
                )
                return 0
            )(else
                (if (== local0 3)
                    (if (not local1)
                        (send gQg3Messager:say(0 5 37))
                    )(else
                        (send gQg3Messager:say(0 5 38))
                    )
                    return 0
                )(else
                    (send gQg3Messager:say(0 5 21))
                    return 0
                )
            )
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 20
                (send global2:doVerb(theVerb))
            )
            (case 33
                (send global2:doVerb(theVerb))
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance johariTell of Teller
    (properties)

    (method (showDialog)
        (super:showDialog(-4 (== local0 2) -13 local1 -3 
            (if (== local0 2)
            )(else
                (== local0 4)
            )
 -6 (== local0 2) -7 
            (if (not (== local0 2) and (== local0 3))
                local1
            )(else
                0
            )
 -5 
            (if (not (== local0 2) and (== local0 3))
                not local1
            )(else
                0
            )
))
    )


    (method (doChild)
        return 
            (switch (query)
                (case -4
                    (if (== local0 2)
                        (if (== local3 1)
                            (send gQg3Messager:say(2 5 3))
                        )(else
                            (send gQg3Messager:say(2 5 25))
                        )
                        return 0
                    )(else
                        return query
                    )
                )
                (case -3
                    (if (== local0 2)
                        (if (== local3 1)
                            (send gQg3Messager:say(2 5 3))
                        )(else
                            (send gQg3Messager:say(2 5 25))
                        )
                        return 0
                    )(else
                        return query
                    )
                )
                (case -6
                    (if (== local0 2)
                        (if (== local3 1)
                            (send gQg3Messager:say(2 5 3))
                        )(else
                            (send gQg3Messager:say(2 5 25))
                        )
                        return 0
                    )(else
                        return query
                    )
                )
                (case -7
                    (if (== local0 2)
                        (if (== local3 1)
                            (send gQg3Messager:say(2 5 3))
                        )(else
                            (send gQg3Messager:say(2 5 25))
                        )
                        return 0
                    )(else
                        (if (== local0 3)
                            (if (not local1)
                                (send gQg3Messager:say(2 5 29))
                                return 0
                            )(else
                                return query
                            )
                        )(else
                            return query
                        )
                    )
                )
                (case -5
                    (if (== local0 2)
                        (if (== local3 1)
                            (send gQg3Messager:say(2 5 3))
                        )(else
                            (send gQg3Messager:say(2 5 25))
                        )
                        return 0
                    )(else
                        return query
                    )
                )
                (default 
                    return query
                )
            )
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 20
                (send global2:doVerb(theVerb))
            )
            (case 33
                (send global2:doVerb(theVerb))
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance throne of Feature
    (properties
        x 90
        y 66
        noun 9
        nsTop 40
        nsLeft 67
        nsBottom 92
        nsRight 114
    )
)
(instance platform of Feature
    (properties
        x 157
        y 61
        z 50
        noun 10
        nsTop 96
        nsLeft 53
        nsBottom 127
        nsRight 261
    )
)
