(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "Game")
(use "Obj")
(script 602)



(instance public regOgreHouse of Rgn
    (properties)

    (method (init)
        (if (initialized)
            return 
        )
        = keep 1
        (super:init())
        (if (not global166)
            (self:setScript(ogreHere))
        )
        = global189 1
    )


    (method (doit)
        (super:doit())
    )


    (method (dispose)
        (if (== keep 0)
            = global189 0
            (super:dispose())
        )
    )


    (method (newRoom param1)
        (if (((== param1 49) and (== gGNewPropX 48)) and (== (ogreHere:state()) 0))
            (ogreHere:seconds(90))
        )
        (if ((== param1 51) and (send gEgo:has(33)))
            (ogreHere:changeState(3))
        )
    )

)
(instance ogreHere of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (= seconds 50  )
            )
            (case 1
                (
                (if ((<> gGNewPropX 51) and (<> gGNewPropX 48))
                    Print(602 0 50 5)
                )
 
                (if (== gGNewPropX 48)
                    = seconds 60
                )(else
                    = seconds 10
                )
 )
            )
            (case 2
                (= global165 1 
                (if (== gGNewPropX 51)
                    Print(602 1)
                    = seconds 60
                )
 )
            )
            (case 3
                (
                (if (not global166)
                    = global165 2
                    (if (== gGNewPropX 51)
                        Print(602 2)
                    )
                )
 = seconds 60  )
            )
            (case 4
                (
                (if ((== gGNewPropX 51) and not global166)
                    = global165 5
                    Print(602 3)
                )
 )
            )
        )
    )

)
