(version 2)
(include "sci.sh")
(exports
    0 giftScript
)
(use "Main")
(use "StopWalk")
(use "Sound")
(use "Cycle")
(use "Obj")
(script 30)



(instance public giftScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                = register 
                    (if (< (send gOwner:heading) 180)
                        0
                    )(else
                        1
                    )
                (send gOwner:
                    setMotion(0)
                    view(33)
                    setCel(0)
                    setLoop(register)
                    cycleSpeed(12)
                    setCycle(End self)
                )
            )
            (case 1
                (send gOwner:
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 2
                = ticks 60
            )
            (case 3
                (send gOwner:
                    setLoop(+ (send gOwner:loop) 2)
                    setCel(0)
                    setCycle(End self)
                )
                (giftSfx:
                    number(930)
                    play()
                )
            )
            (case 4
                (send gQg3Messager:say(26 6 28 0 0 0))
                (send gOwner:
                    view(0)
                    cycleSpeed(gNewSpeed)
                    setLoop(-1)
                    setLoop(ScriptID(28 1))
                    setCycle(StopWalk 5)
                )
                = ticks 60
            )
            (case 5
                proc0_3()
                proc0_16()
                (self:dispose())
            )
        )
    )

)
(instance giftSfx of Sound
    (properties)
)
