(version 2)
(include "sci.sh")
(exports
    0 Glory
    1 proc0_1
    2 proc0_2
    3 proc0_3
    4 proc0_4
    5 proc0_5
    6 proc0_6
    7 proc0_7
    8 proc0_8
    9 proc0_9
    10 proc0_10
    11 proc0_11
    12 proc0_12
    13 proc0_13
    14 proc0_14
    15 proc0_15
    16 proc0_16
    17 textIcon
    20 mainIconBar
)
(use "GloryWindow")
(use "n026")
(use "Print")
(use "Messager")
(use "PseudoMouse")
(use "IconI")
(use "PolyPath")
(use "Polygon")
(use "StopWalk")
(use "DCIcon")
(use "Timer")
(use "GameControls")
(use "Sound")
(use "Cycle")
(use "File")
(use "Game")
(use "User")
(use "View")
(use "Obj")
(script 0)


(local
    gOwner
    gGame
    global2
    gNewSpeed =     6
    global4
    gGQg3KDHandler
    gRegions
    gTimers
    gSounds
    gInv
    gOldATPs
    gClientModNum
    gGClientModNum
    gNewRoomNumber
    global14
    global15
    global16
    global17 =     7
    gNewSet
    gCursorNumber
    global20 =     999
    global21 =     997
    gFont
    gFont_2 =     4
    gPEvent
    gDialog
    global26
    global27
    global28
    global29
    global30 =     10
    gPicAngle
    gNewFeatures
    gSFeatures
    global34
    global35
    gPicNumber =     -1
    global37
    gGloryWindow
    global39
    global40
    global41
    global42
    global43
    global44
    global45
    global46
    global47
    global48
    global49
    global50
    global51
    global52
    global53
    global54
    global55
    global56
    global57
    global58
    global59
    global60
    global61
    global62
    global63
    gQg3FtrInit
    gQg3DoVerbCode
    gQg3ApproachCode
    global67 =     1
    global68
    gMainIconBar
    gTargetX
    gPEventY
    gQg3KDHandler
    gQg3MDHandler
    gQg3DirHandler
    global75
    global76
    gPseudoMouse
    gTheDoits
    gEatTheMice =     60
    gUser
    global81
    global82
    global83
    gNewEventHandler
    gFont_3
    global86
    global87
    gLastTicks
    gNarrator
    global90
    gQg3Messager
    global92
    gQg3Walkers
    global94 =     2
    global95
    global96
    global97
    global98
    global99
    global100
    global101 =     1234
    global102
    gLongSong
    global104
    global105
    global106
    global107
    global108
    global109
    global110
    global111
    global112
    global113
    global114
    global115
    global116
    global117
    global118
    global119
    global120
    global121
    global122
    global123
    global124
    global125
    gGOwnerMoveSpeed
    global127
    global128
    global129
    global130
    global131
    global132
    global133
    global134 =     20
    global135 =     15
    global136
    global137
    global138 =     9
    global139 =     12
    global140
    global141
    global142
    global143
    global144 =     180
    global145
    global146 =     45
    global147 =     90
    global148 =     135
    global149 =     180
    global150 =     225
    global151 =     270
    global152 =     315
    global153
    global154
    global155
    gGMonsterMonHP
    global157
    global158
    global159
    global160
    global161
    global162
    global163
    global164
    global165
    global166
    global167
    global168
    global169
    global170
    global171
    global172
    global173
    global174
    global175
    global176
    global177
    global178
    global179
    global180
    global181
    global182
    global183
    global184
    global185
    global186
    global187
    global188
    global189
    global190
    global191
    global192
    global193
    global194
    global195
    global196
    global197
    global198 =     20
    gLongSong2
    global200
    global201
    gGTargetX
    gGPEventY
    gGMainIconBarCurIcon
    global205
    global206
    global207
    global208
    global209 =     2
    gGGOwnerMaxStamina
    gGGOwnerMaxStamina_2
    global212
    global213
    global214
    global215
    global216
    global217
    global218
    global219
    global220
    global221
    global222
    global223
    global224
    global225
    global226
    global227
    global228
    global229
    global230
    global231
    global232
    global233
    global234
    global235
    global236
    global237
    global238
    global239
    global240
    global241
    global242
    global243
    global244
    global245
    global246
    global247
    global248
    global249
    global250
    gGOwnerMaxStamina
    global252
    global253
    global254
    global255
    global256
    global257
    global258
    global259
    global260
    global261
    global262
    global263
    global264
    global265
    global266
    global267
    global268
    global269
    global270
    global271
    global272
    global273
    global274
    global275
    global276
    global277
    global278
    global279
    global280
    global281
    global282
    global283
    global284
    global285
    global286
    global287
    global288
    global289
    global290
    global291
    global292
    global293
    global294
    global295
    global296
    global297
    global298
    global299
    global300
    global301
    global302
    global303
    global304
    global305
    global306
    global307
    global308
    global309
    global310
    global311
    global312
    global313
    global314
    global315
    global316
    global317
    global318
    global319
    global320
    global321
    global322
    global323
    global324
    global325
    global326
    global327
    global328
    global329
    global330
    global331
    global332
    global333
    global334
    global335
    global336
    global337
    global338
    global339
    global340
    global341
    global342
    global343
    global344
    global345
    global346
    global347
    global348
    global349
    global350
    global351
    global352
    global353
    global354
    global355
    global356
    global357
    global358
    global359
    global360
    global361
    global362
    gGOwnerX
    gGOwnerY
    global365
    global366
    global367 =     2
    global368 =     2
    global369 =     3
    global370 =     3
    global371 =     3
    global372 =     4
    global373 =     5
    global374 =     5
    global375 =     6
    global376 =     7
    global377 =     8
    global378 =     8
    global379 =     5
    global380 =     10
    global381 =     3
    global382 =     3
    global383 =     3
    global384 =     3
    global385 =     3
    global386
    global387
    global388
    global389
    global390
    global391
    global392
    gNewList
    global394
    global395
    global396
    global397
    global398
    global399
    global400
    global401
    global402
    global403 =     1
    gGGOwnerMaxStamina_3
    global405 =     4
    global406
    global407
    global408
    global409
    global410
    global411 =     1
    gMonster
    gWarriorObj
    global414
    gGOwnerX_2
    gGOwnerY_2
    global417
    global418
    gCalledBy
    global420
    global421
    gGOwnerX_3
    gGOwnerY_3
    global424
    global425
    global426
    global427
    gGOwnerX_4
    gGOwnerY_4
    global430
    global431
    global432
    global433
    global434
    global435
    global436
    global437
    global438
    global439
    global440
    global441
    global442
    global443
    global444
    global445
    global446
    global447
    global448
    global449
    global450
    global451
    global452
    global453
    global454
    global455
    global456
    gLongSong3
    gNewCollect
    global459
    gCursor
    global461
    global462
    global463
    global464
    global465
    global466
    gGloryWindow_2
    gGClientModNum_2
    gNewGameControls
    global470
    global471
    global472
    global473
    global474
    global475
    global476
    global477
    global478
    global479
    global480
    global481
    global482
    global483
    global484
    global485
    global486
    global487
    global488
    global489
    global490
    global491
    global492
    global493
    global494
    global495
    global496
    global497
    global498
    global499
    global500
    global501
    global502
    global503
    global504
    global505
    global506
    global507
    global508
    global509
    global510
    global511
    global512
    global513
    global514
    global515
    global516
    global517
    global518
    global519
    global520
    global521
    global522
    global523
    global524
    global525
    global526
    global527
    global528
    global529
    global530
    global531
    global532
    global533
    global534
    global535
    global536
    global537
    global538
    global539
    global540
    global541
    global542
    global543
    global544
    global545
    global546
    global547
    global548
    global549
    global550
    global551
    global552
    global553
    global554
    global555
    global556
    global557
    global558
    global559
    global560
    global561
    global562
    global563
    global564
    global565
    global566
    global567
    global568
    global569
    global570
    global571
    global572
    global573
    global574
    global575
    global576
    global577
    global578
    global579
    global580
    global581
    global582
    global583
    global584
    global585
    global586
    global587
    global588
    global589
    global590
    global591
    global592
    global593
    global594
    global595
    global596
    global597
    global598
    global599
    global600
    global601
    global602
    global603
    global604
    global605
    global606
    global607
    global608
    global609
    global610
    global611
    global612
    global613
    global614
    global615
    global616
    global617
    global618
    global619
    global620
    global621
    global622
    global623
    global624
    global625
    global626
    global627
    global628
    global629
    global630
    global631
    global632
    global633
    global634
    global635
    global636
    global637
    global638
    global639
    global640
    global641
    global642
    global643
    global644
    global645
    global646
    global647
    global648
    global649
    global650
    global651
    global652
    global653
    global654
    global655
    global656
    global657
    global658
    global659
    global660
    global661
    global662
    global663
    global664
    global665
    global666
    global667
    global668
    global669
    global670
    global671
    global672
    global673
    global674
    global675
    global676
    global677
    global678
    global679
    global680
    global681
    global682
    global683
    global684
    global685
    global686
    global687
    global688
    global689
    global690
    global691
    global692
    global693
    global694
    global695
    global696
    global697
    global698
    global699
    global700

)
(procedure public (proc0_1 param1)
    return > MemoryInfo(0) param1
)


(procedure public (proc0_2)
    = global208 1
    proc0_9()
    (User:
        canControl(0)
        canInput(0)
    )
    = global200 0
    (send gMainIconBar:eachElementDo(96 checkIcon))
    (send gMainIconBar:disable(1 2 3 4 5 6 7 8))
    (if (not HaveMouse())
        = gGTargetX gTargetX
        = gGPEventY gPEventY
        (send gGame:setCursor(global21 1 310 185))
    )(else
        (send gGame:setCursor(global21 1))
    )
)


(procedure public (proc0_3 param1 param2)
    (var temp0[31])
    = global208 0
    (User:
        canControl(1)
        canInput(1)
    )
    (send gMainIconBar:enable(1 2 3 4 5 6 7 8 9))
    proc0_10()
    (if (not (send gMainIconBar:curInvIcon))
        (send gMainIconBar:disable(7))
    )
    (if (not HaveMouse())
        (send gGame:setCursor((send ((send gMainIconBar:curIcon)):cursor) 1 gGTargetX gGPEventY))
    )(else
        (send gGame:setCursor((send ((send gMainIconBar:curIcon)):cursor) 1))
    )
    (if (> paramTotal 0)
        (send gMainIconBar:disable(param1 rest param2))
    )
)


(procedure public (proc0_4 param1)
    = global500[(/ param1 16)] (| global500[(/ param1 16)] (>> $8000 (% param1 16)))
)


(procedure public (proc0_5 param1)
    = global500[(/ param1 16)] (& global500[(/ param1 16)] bnot (>> $8000 (% param1 16)))
)


(procedure public (proc0_6 param1)
    return & global500[(/ param1 16)] (>> $8000 (% param1 16))
)


(procedure public (proc0_7)
)


(procedure public (proc0_8)
    return + 1 (/ Random(0 2999) 10)
)


(procedure public (proc0_9)
    (if (not IsObject(gGMainIconBarCurIcon) and IsObject((send gMainIconBar:curIcon)))
        = gGMainIconBarCurIcon (send gMainIconBar:curIcon)
    )
)


(procedure public (proc0_10)
    (if (IsObject(gGMainIconBarCurIcon))
        (send gMainIconBar:curIcon(gGMainIconBarCurIcon))
        (send gGame:setCursor((send ((send gMainIconBar:curIcon)):cursor)))
        = gGMainIconBarCurIcon 0
        (if ((== (send gMainIconBar:curIcon) (send gMainIconBar:at(7))) and not (send gMainIconBar:curInvIcon))
            (send gMainIconBar:advanceCurIcon())
        )
    )
)


(procedure public (proc0_11)
    proc0_5(31)
    proc0_5(135)
    return ++global122
)


(procedure public (proc0_12 param1 param2 param3 param4)
    (var temp0, temp1, temp2, temp3)
    = temp3 0
    (if (IsObject(param2))
        = temp1 (send param2:x)
        = temp2 (send param2:y)
        (if (== paramTotal 3)
            = temp3 param3
        )
    )(else
        = temp1 param2
        = temp2 param3
        (if (== paramTotal 4)
            = temp3 param4
        )
    )
    = temp0 GetAngle((send param1:x) (send param1:y) temp1 temp2)
    (send param1:setHeading(temp0 
        (if (IsObject(temp3))
            temp3
        )(else
            0
        )
))
)


(procedure public (proc0_13)
    proc0_3()
    (send gMainIconBar:disable(1 3 5 6 7 8))
)


(procedure public (proc0_14 param1 param2)
    = global386 0
    = global387 0
    (if (paramTotal)
        = global386 param1
        (if (> paramTotal 1)
            = global387 param2
        )
    )
)


(procedure public (proc0_15 param1)
    (if (not proc0_6(101))
        Palette(palANIMATE rest param1)
    )
)


(procedure public (proc0_16)
    (var temp0, temp1)
    = temp1 -32768
    = temp0 0
    (while (<= temp0 10)
        (if (& global200 temp1)
            (send gMainIconBar:disable(temp0))
        )
        = temp1 (>> temp1 $0001)
        ++temp0
    )
)


(procedure (localproc_1380)
    (var temp0, temp1[400], temp401[21], temp422, temp423)
    = temp0 GetSaveFiles((send gGame:name) @temp1 @temp401)
    = temp422 1
    (while (1)
        = temp423 0
        (while (not (< temp423 temp0) or (== temp422 temp401[temp423]))
        )
        (if (== temp423 temp0)
            break
        )
        ++temp422
    )
    return temp422
)


(procedure (localproc_2d7a param1 param2)
    (var temp0[400], temp400[21], temp421, temp422, newFile, temp424)
    = temp421 GetSaveFiles((send gGame:name) @temp0 @temp400)
    = newFile (File:new())
    (send newFile:
        name(DeviceInfo(7 param2 (send gGame:name)))
        open(2)
    )
    = temp424 2570
    = temp422 0
    (while (< temp422 temp421)
        (if (<> temp422 param1)
            (send newFile:write(@temp400[temp422] 2))
            (send newFile:writeString(@temp0[(* temp422 18)]))
            (send newFile:write(@temp424 1))
        )
        ++temp422
    )
    = temp424 -1
    (send newFile:
        write(@temp424 2)
        close()
        dispose()
    )
    DeviceInfo(8 param2 (send gGame:name) temp400[param1])
    FileIO(fiUNLINK param2)
    DisposeScript(993)
)


(instance qg3KDHandler of EventHandler
    (properties)
)
(instance qg3MDHandler of EventHandler
    (properties)
)
(instance qg3DirHandler of EventHandler
    (properties)
)
(instance qg3Walkers of EventHandler
    (properties)
)
(class public Glory of Game
    (properties
        script 0
        parseLang 1
        printLang 1
        subtitleLang 0
        _detailLevel 3
        panelObj 0
        panelSelector 0
    )

    (method (init)
        (var theStopWalk, temp1, temp2[2])
        = gGloryWindow GloryWindow
        = gOwner ScriptID(28 0)
        (send gOwner:view(0))
        = global17 -32761
        (Actor:origStep(1027))
        = global102 2
        = global21 945
        = theStopWalk StopWalk
        Timer
        Polygon
        PolyPath
        (super:init())
        = global27 "x.yyy.zzz"
        = temp1 FileIO(fiOPEN "version" 1)
        FileIO(fiREAD_STRING global27 11 temp1)
        FileIO(fiCLOSE temp1)
        = gQg3DoVerbCode qg3DoVerbCode
        = gQg3FtrInit qg3FtrInit
        = gQg3ApproachCode qg3ApproachCode
        = gQg3Messager qg3Messager
        = gQg3KDHandler qg3KDHandler
        (send gQg3KDHandler:add())
        = gQg3MDHandler qg3MDHandler
        (send gQg3MDHandler:add())
        = gQg3DirHandler qg3DirHandler
        (send gQg3DirHandler:add())
        = gQg3Walkers qg3Walkers
        (send gQg3Walkers:add())
        = gPseudoMouse PseudoMouse
        = gLongSong longSong
        (send gLongSong:
            owner(self)
            flags(1)
            init()
        )
        = gLongSong2 longSong2
        (send gLongSong2:
            owner(self)
            flags(1)
            init()
        )
        = gLongSong3 longSong3
        (send gLongSong3:
            owner(self)
            flags(1)
            init()
        )
        = gMainIconBar mainIconBar
        (send gMainIconBar:
            init()
            disable(7 iconLeft iconRight)
            curIcon(iconLook)
        )
        (send (ScriptID(16 0)):init())
        (send (ScriptID(1)):init())
        proc0_4(14)
    )


    (method (doit)
        (var temp0, temp1, gOwnerMover)
        (super:doit())
        (if (proc0_6(6))
            = temp0 GetTime(1)
            (if (<> global124 temp0)
                = global124 temp0
                (if (not proc0_6(7))
                    = temp1 global120
                    (if (>= ++global120 3600)
                        = global120 0
                        proc0_11()
                    )
                    (if (< (% global120 150) (% temp1 150))
                        (send (ScriptID(7 4)):init())
                    )
                    (if (((>= global120 772) and proc0_6(81)) and not proc0_6(31))
                        PalVary(pvREVERSE 64)
                        proc0_5(81)
                        proc0_4(131)
                    )(else
                        (if ((<= 2700 global120) and not proc0_6(81))
                            proc0_4(31)
                            PalVary(pvINIT gClientModNum 64)
                            proc0_4(131)
                            proc0_4(81)
                        )
                    )
                )
                (if ((> global120 2750) and proc0_6(81))
                    = global121 1
                    = global40 1
                )(else
                    (if ((> global120 790) and not proc0_6(81))
                        = global121 0
                        = global40 0
                    )
                )
                (if (((((((((((not proc0_6(35) and not proc0_6(130)) and (>= global122 1)) and (>= global120 2200)) and not (send global2:script)) and not gGMonsterMonHP) and not (send gOwner:script)) and not IsObject(gNewEventHandler)) and gGOwnerMaxStamina[16]) and not proc999_5(gClientModNum 230 240 250 260)) and (<> gClientModNum 340)) and (<> gClientModNum 550))
                    proc0_4(130)
                    (send (ScriptID(7 4)):init(19))
                    (send gQg3Messager:say(26 6 20 0 0 0))
                    (if (== gClientModNum 310)
                        (send global2:setScript(ScriptID(310 1)))
                    )(else
                        (send gLongSong2:fade())
                        (send gLongSong3:fade())
                        (send global2:newRoom(310))
                    )
                )
                (if ((== global100 2) and (send gOwner:mover))
                    (send gOwner:useSkill(8 2))
                )
                (if ((((< 1100 global120) and (< global120 1200)) or ((< 2500 global120) and (< global120 2600))) and not global141)
                    (if (> global120 2500)
                        = global141 2650
                    )(else
                        = global141 1250
                    )
                    (send gOwner:eatMeal())
                )(else
                    (if (> global120 global141)
                        = global141 0
                    )
                )
                = global463 (- global463 global411)
                (if (<= global463 0)
                    = global463 100
                    (if (proc0_6(3))
                        (send gOwner:eatMeal())
                    )
                )
                = global134 (- global134 global411)
                (if (<= global134 0)
                    = global134 20
                    (if ((> global137 1) or proc0_6(5))
                        (send gOwner:useStamina(5))
                        (if (proc0_6(5))
                            (send gOwner:useStamina((>> global465 $0007)))
                            (send gOwner:useSkill(0 2))
                        )
                    )(else
                        = gOwnerMover (send gOwner:mover)
                        (if (gOwnerMover and (== global100 1))
                            (send gOwner:useStamina(4))
                        )(else
                            (if (gOwnerMover and (== global100 2))
                                (send gOwner:useStamina(1))
                            )(else
                                (send gOwner:useStamina(-2))
                            )
                        )
                    )
                )
                (if (not --global198)
                    = global198 20
                    (send gOwner:useMana(-1))
                )
                (if (not --global135)
                    = global135 15
                    (if (not 
                    (if ((> global137 1) or proc0_6(3))
                    )(else
                        proc0_6(115)
                    )
)
                        (send gOwner:takeDamage(-1))
                    )
                    (if (proc0_6(115))
                        (if (not (send gOwner:takeDamage(3)))
                            proc26_0(27 28)
                        )(else
                            (if (< gGOwnerMaxStamina[16] (>> (send gOwner:maxHealth()) $0003))
                                (send gQg3Messager:say(2 0 28 0 0 28))
                            )
                        )
                    )
                )
            )
            (if (not proc0_6(7) and proc0_6(8))
                (switch (--gGGOwnerMaxStamina)
                    (case 0
                        proc0_5(8)
                        (send gQg3Messager:say(0 0 10 0 0 0))
                    )
                    (case 10
                        (send gQg3Messager:say(0 0 11 0 0 0))
                    )
                )
            )
        )
    )


    (method (newRoom newRoomNumber)
        (var temp0[3], newEvent)
        (if (IsObject(gNewCollect))
            (send gNewCollect:dispose())
            = gNewCollect 0
        )
        (while (IsObject(gNewEventHandler))
            (send gNewEventHandler:eachElementDo(57))
            = newEvent (Event:new())
            (if ((send newEvent:type) and gNewEventHandler)
                (send gNewEventHandler:firstTrue(#handleEvent newEvent))
            )
            (send newEvent:dispose())
            (send gTheDoits:doit())
        )
        (super:newRoom(rest newRoomNumber))
    )


    (method (startRoom param1)
        (var temp0)
        proc0_9()
        (send gGame:setCursor(global21 1))
        (send (ScriptID(27 0)):init(param1))
        DisposeScript(27)
        (if (((<> (- MemoryInfo(1) 2) MemoryInfo(0)) and FileIO(fiEXISTS "18.scr")) and (send gQg3Messager:say(0 0 12 0 0 0)))
            SetDebug()
        )
        (if (proc999_5(param1 230 240 250 260))
            ScriptID(51)
        )
        StopWalk
        Cycle
        (if (FileIO(fiEXISTS "18.scr"))
            (send (ScriptID(18 0)):init())
        )
        (send gOwner:edgeHit(0))
        = global201 0
        (super:startRoom(param1))
        (if (not global208)
            proc0_10()
            (send gGame:setCursor((send ((send gMainIconBar:curIcon)):cursor) 1))
        )
    )


    (method (restart)
        (send global2:
            style(6)
            drawPic(0)
        )
        (send gGQg3KDHandler:eachElementDo(111))
        (super:restart())
    )


    (method (save param1 param2)
        (var temp0[400], temp400[21], temp421[18], temp439[41], temp480[70], temp550, temp551, temp552, temp553, temp554, newEvent, temp556[30])
        (if ((== paramTotal 1) and (== param1 1))
            GetCWD(@temp480)
            (if (gDialog)
                (send gDialog:dispose())
            )
            = temp550 GetSaveFiles((send gGame:name) @temp0 @temp400)
            Message(0 0 0 0 16 1 @temp439)
            = temp552 0
            = temp551 -1
            = temp553 0
            (while (< temp553 temp550)
                = temp552 StrCmp(@temp439 @temp0[(* temp553 18)])
                (if (not temp552)
                    break
                )
                ++temp553
            )
            (if (>= temp551 0)
                localproc_2d7a(temp551 @temp439)
                = temp550 GetSaveFiles((send gGame:name) @temp0 @temp400)
                (while ((> temp550 0) and not CheckFreeSpace(@temp480))
                    localproc_2d7a(- temp550 1 @temp0[* (- temp550 1) 18])
                    = temp550 GetSaveFiles((send gGame:name) @temp0 @temp400)
                )
                (if (CheckFreeSpace(@temp480))
                    Message(0 0 0 0 16 1 @temp421)
                    = temp554 localproc_1380()
                    (if (not SaveGame(name temp554 @temp421 global27))
                        Message(0 0 0 17 1 @temp556)
                        (Print:
                            addTextF(@temp556)
                            init()
                        )
                        return 
                    )(else
                        (if (not 
                        (if (paramTotal)
                            param1
                        )
)
                            Message(0 0 0 18 1 @temp556)
                            (Print:
                                addTextF(@temp556)
                                init()
                            )
                        )
                        = temp550 GetSaveFiles((send gGame:name) @temp0 @temp400)
                    )
                )(else
                    Message(0 0 0 0 19 1 @temp556)
                    (Print:
                        addTextF(@temp556)
                        init()
                    )
                    return 
                )
            )(else
                (while ((> temp550 0) and (not CheckFreeSpace(@temp480) or (>= temp550 20)))
                    localproc_2d7a(- temp550 1 @temp0[* (- temp550 1) 18])
                    = temp550 GetSaveFiles((send gGame:name) @temp0 @temp400)
                )
                Message(0 0 0 0 16 1 @temp421)
                = temp554 localproc_1380()
                (if (not SaveGame(name temp554 @temp421 global27))
                    Message(0 0 0 17 1 @temp556)
                    (Print:
                        addTextF(@temp556)
                        init()
                    )
                    return 
                )(else
                    (if (not 
                    (if (paramTotal)
                        param1
                    )
)
                        Message(0 0 0 18 1 @temp556)
                        (Print:
                            addTextF(@temp556)
                            init()
                        )
                    )
                    = temp550 GetSaveFiles((send gGame:name) @temp0 @temp400)
                )
            )
            (while ((send (= newEvent (Event:new())):type))
                (send newEvent:dispose())
            )
            (send newEvent:dispose())
        )(else
            (super:save(rest param2))
        )
        (send gGame:setCursor((send ((mainIconBar:curIcon)):cursor)))
    )


    (method (handleEvent pEvent)
        (if (== (send pEvent:type) 2)
            (send gQg3MDHandler:handleEvent(pEvent))
        )(else
            (super:handleEvent(pEvent))
        )
        return 
            (if ((send pEvent:claimed))
                return 1
            )(else
                0
            )
    )


    (method (setSpeed newSpeed)
        (if (paramTotal and (User:canControl()))
            (send gOwner:setSpeed(newSpeed))
            (super:setSpeed(newSpeed))
        )
        (send gOwner:moveSpeed)
    )


    (method (setCursor cursorNumber param2 param3 param4)
        (var theGCursorNumber)
        = theGCursorNumber gCursorNumber
        (if (paramTotal)
            (if (IsObject(cursorNumber))
                = gCursorNumber cursorNumber
                (send gCursorNumber:init())
            )(else
                = gCursorNumber cursorNumber
                SetCursor(gCursorNumber 0 0)
            )
        )
        (if ((> paramTotal 1) and not param2)
            SetCursor(996 0 0)
        )
        (if (> paramTotal 2)
            SetCursor(param3 param4)
        )
        return theGCursorNumber
    )


    (method (quitGame)
        (var newIconI, temp1)
        = temp1 (send gGame:setCursor(999))
        = gNewGameControls (GameControls:new())
        (send gNewGameControls:window((send ((GloryWindow:new())):
                top(30)
                left(65)
                bottom(120)
                right(256)
                priority(15)
                yourself()
            )
))
        = newIconI (textIcon:new(0 0 13 1 0))
        (send newIconI:
            view(935)
            loop(1)
            cel(0)
            nsTop(2)
            nsLeft(2)
            modifiers(1)
        )
        (send gNewGameControls:add(newIconI))
        = newIconI (textIcon:new(0 0 14 1 0))
        (send newIconI:
            nsTop(70)
            nsLeft(80)
            cursor(1)
        )
        (send gNewGameControls:add(newIconI))
        = newIconI (textIcon:new(0 0 15 1 0))
        (send newIconI:
            nsTop(70)
            nsLeft(145)
            cursor(2)
        )
        (send gNewGameControls:add(newIconI))
        = newIconI (IconI:new())
        (send newIconI:
            nsTop(30)
            nsLeft(20)
            view(937)
            loop(1)
            cel(0)
            maskView(937)
            maskLoop(1)
            maskCel(0)
            signal(132)
        )
        (send gNewGameControls:add(newIconI))
        (send gNewGameControls:
            show()
            dispose()
        )
        (switch (gCursor)
            (case 1
                = global4 1
            )
            (case 2
                (send gGame:setCursor(temp1))
            )
        )
    )


    (method (pragmaFail)
        (var temp0)
        (if ((User:canInput()))
            = temp0 (send ((User:curEvent)):message)
            (if (gDialog)
                (send gDialog:dispose())
            )
            (switch (temp0)
                (case 1
                    (send gQg3Messager:say(24 1 0 0 0 0))
                )
                (case 4
                    (send gQg3Messager:say(24 4 0 0 0 0))
                )
                (case 2
                    (send gQg3Messager:say(24 2 0 0 0 0))
                )
                (case 74
                    (if (proc999_5(gClientModNum 150 160 170 180 310 390 400 430 440 600 700 770 780 820))
                        (send global2:doVerb(74))
                    )(else
                        (send gQg3Messager:say(24 0 9 0 0 0))
                    )
                )
                (case 81
                    (if (proc999_5(gClientModNum 230 280 310 380 400 430 650 700 810 820 851 852 853 854))
                        (send global2:doVerb(81))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 83
                    (if (proc999_5(gClientModNum 0 230 280 310 380 400 430 700 810 820 851 852 853 854))
                        (send global2:doVerb(83))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 88
                    (if (proc999_5(gClientModNum 0 230 280 310 380 400 430 700 810 820 851 852 853 854))
                        (send global2:doVerb(88))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 75
                    (if (proc999_5(gClientModNum 230 310 380 430 450 640 650 700 810 820 853))
                        (send global2:doVerb(75))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 76
                    (if (proc999_5(gClientModNum 230 280 310 390 430 650 770 780 810 853))
                        (send global2:doVerb(76))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 77
                    (if (proc999_5(gClientModNum 230 280 310 400 430 650 700 850 851 852 853 854))
                        (send global2:doVerb(77))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 78
                    (if (proc999_5(gClientModNum 230 280 310 400 430 650 700 851 852 853 854))
                        (send global2:doVerb(78))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 80
                    (if (proc999_5(gClientModNum 230 280 310 390 400 430 450 630 650 700 820 850 851 852 853 854))
                        (send global2:doVerb(80))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 82
                    (if (proc999_5(gClientModNum 230 280 310 380 430 640 650 700 810))
                        (send global2:doVerb(82))
                    )(else
                        (if (> (send gOwner:view) 5)
                            (send gQg3Messager:say(0 0 21 1 0 0))
                        )(else
                            (send gOwner:setScript(ScriptID(37)))
                        )
                    )
                )
                (case 84
                    (if (proc999_5(gClientModNum 280 310 400 430 650 700 720 740 851 852 853 854))
                        (send global2:doVerb(84))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 87
                    (if (proc999_5(gClientModNum 280 310 400 430 650 700 850 853))
                        (send global2:doVerb(87))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 85
                    (if (proc999_5(gClientModNum 280 310 400 430 650 700 850 853))
                        (send global2:doVerb(85))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 86
                    (if (proc999_5(gClientModNum 230 280 310 400 430 650 700 853))
                        (send global2:doVerb(86))
                    )(else
                        (send gQg3Messager:say(24 0 8 0 0 0))
                    )
                )
                (case 66
                    (send gQg3Messager:say(24 66 22 0 0 0))
                )
                (case 20
                    (if (proc999_5(gClientModNum 230 400 460 700))
                        (send global2:doVerb(20))
                    )(else
                        (send gQg3Messager:say(24 0 7 0 0 0))
                    )
                )
                (case 33
                    (if (proc999_5(gClientModNum 400 700))
                        (send global2:doVerb(33))
                    )(else
                        (send gQg3Messager:say(24 0 7 0 0 0))
                    )
                )
                (case 13
                    (if (proc999_5(gClientModNum 380 810 851 852))
                        (send global2:doVerb(13))
                    )(else
                        (send gQg3Messager:say(24 0 7 0 0 0))
                    )
                )
                (case 56
                    (if (proc999_5(gClientModNum 380 851))
                        (send global2:doVerb(56))
                    )(else
                        (send gQg3Messager:say(24 0 7 0 0 0))
                    )
                )
                (case 16
                    (if (proc999_5(gClientModNum 0))
                        (send global2:doVerb(16))
                    )(else
                        (send gQg3Messager:say(24 0 7 0 0 0))
                    )
                )
                (default 
                    (send gQg3Messager:say(24 0 6 0 0 0))
                )
            )
        )
    )


    (method (showAbout)
        (send (ScriptID(19 0)):doit())
    )

)
(instance theIcon1 of DCIcon
    (properties
        cycleSpeed 16
    )

    (method (init)
        (send (= cycler (End:new())):init(self))
    )

)
(instance checkIcon of Code
    (properties)

    (method (doit param1)
        (if ((send param1:isKindOf(IconI)) and (& (send param1:signal) $0004))
            = global200 (| global200 (>> $8000 (send gMainIconBar:indexOf(param1))))
        )
    )

)
(instance qg3DoVerbCode of Code
    (properties)

    (method (doit param1)
        (if (gDialog)
            (send gDialog:dispose())
        )
        (switch (param1)
            (case 3
                (send ((User:curEvent)):claimed(0))
            )
            (case 1
                (send gQg3Messager:say(25 1 0 0 0 0))
            )
            (case 4
                (send gQg3Messager:say(25 4 0 0 0 0))
            )
            (case 2
                (send gQg3Messager:say(25 2 0 0 0 0))
            )
            (case 74
                (if (proc999_5(gClientModNum 150 160 170 180 310 390 400 430 440 600 700 770 780 820))
                    (send global2:doVerb(74))
                )(else
                    (send gQg3Messager:say(24 0 9 0 0 0))
                )
            )
            (case 81
                (if (proc999_5(gClientModNum 230 280 310 380 400 430 650 700 810 820 851 852 853 854))
                    (send global2:doVerb(81))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 83
                (if (proc999_5(gClientModNum 0 230 280 310 380 400 430 700 810 820 851 852 853 854))
                    (send global2:doVerb(83))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 88
                (if (proc999_5(gClientModNum 0 230 280 310 380 400 430 700 810 820 851 852 853 854))
                    (send global2:doVerb(88))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 75
                (if (proc999_5(gClientModNum 230 310 380 430 450 640 650 700 810 820 853))
                    (send global2:doVerb(75))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 76
                (if (proc999_5(gClientModNum 230 280 310 390 430 650 770 780 810 853))
                    (send global2:doVerb(76))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 77
                (if (proc999_5(gClientModNum 230 280 310 400 430 650 700 850 851 852 853 854))
                    (send global2:doVerb(77))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 78
                (if (proc999_5(gClientModNum 230 280 310 400 430 650 700 851 852 853 854))
                    (send global2:doVerb(78))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 80
                (if (proc999_5(gClientModNum 230 280 310 390 400 430 450 630 650 700 820 850 851 852 853 854))
                    (send global2:doVerb(80))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 82
                (if (proc999_5(gClientModNum 230 280 310 380 430 640 650 700 810))
                    (send global2:doVerb(82))
                )(else
                    (if (> (send gOwner:view) 5)
                        (send gQg3Messager:say(0 0 21 1 0 0))
                    )(else
                        (send gOwner:setScript(ScriptID(37)))
                    )
                )
            )
            (case 84
                (if (proc999_5(gClientModNum 280 310 400 430 650 700 720 740 851 852 853 854))
                    (send global2:doVerb(84))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 87
                (if (proc999_5(gClientModNum 280 310 400 430 650 700 850 853))
                    (send global2:doVerb(87))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 85
                (if (proc999_5(gClientModNum 280 310 400 430 650 700 850 853))
                    (send global2:doVerb(85))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 86
                (if (proc999_5(gClientModNum 230 280 310 400 430 650 700 853))
                    (send global2:doVerb(86))
                )(else
                    (send gQg3Messager:say(25 0 3 0 0 0))
                )
            )
            (case 66
                (send gQg3Messager:say(25 66 23 0 0 0))
            )
            (case 20
                (if (proc999_5(gClientModNum 230 400 460 700))
                    (send global2:doVerb(20))
                )(else
                    (send gQg3Messager:say(25 0 7 0 0 0))
                )
            )
            (case 16
                (if (proc999_5(gClientModNum 0))
                    (send global2:doVerb(16))
                )(else
                    (send gQg3Messager:say(25 0 7 0 0 0))
                )
            )
            (case 33
                (if (proc999_5(gClientModNum 400 700))
                    (send global2:doVerb(33))
                )(else
                    (send gQg3Messager:say(25 0 7 0 0 0))
                )
            )
            (case 13
                (if (proc999_5(gClientModNum 380 810 851 852))
                    (send global2:doVerb(13))
                )(else
                    (send gQg3Messager:say(25 0 7 0 0 0))
                )
            )
            (case 56
                (if (proc999_5(gClientModNum 380 851))
                    (send global2:doVerb(56))
                )(else
                    (send gQg3Messager:say(25 0 7 0 0 0))
                )
            )
            (default 
                (send gQg3Messager:say(25 0 5 0 0 0))
            )
        )
    )

)
(instance qg3FtrInit of Code
    (properties)

    (method (doit param1)
        (if (== (send param1:sightAngle) 26505)
            (send param1:sightAngle(40))
        )
        (if (== (send param1:actions) 26505)
            (send param1:actions(0))
        )
        (if (not (send param1:approachX) and not (send param1:approachY))
            (send param1:
                approachX((send param1:x))
                approachY((send param1:y))
            )
        )
    )

)
(instance qg3ApproachCode of Code
    (properties)

    (method (doit param1)
        return 
            (if (== param1 1)
                1
            )(else
                (if (== param1 2)
                    2
                )(else
                    (if (== param1 3)
                        4
                    )(else
                        (if (== param1 4)
                            8
                        )(else
                            (if ((<= 10 param1) and (<= param1 59))
                                16
                            )(else
                                (if ((<= 75 param1) and (<= param1 88))
                                    32
                                )(else
                                    (if (== param1 -1)
                                        -1
                                    )(else
                                        -32768
                                    )
                                )
                            )
                        )
                    )
                )
            )
    )

)
(class MessObj of Obj
    (properties
        noun 0
        verb 0
        case 0
        seq 0
        who 0
        module 0
        said 0
        argCount 0
    )

    (method (new param1 param2 param3 param4 param5 param6)
        (var temp0)
        = temp0 Clone(self)
        (send temp0:
            argCount(paramTotal)
            noun(param1)
            verb(param2)
            case(param3)
        )
        (if (> paramTotal 2)
            (send temp0:seq(param4))
            (if (> paramTotal 3)
                (send temp0:who(param5))
                (if (> paramTotal 4)
                    (send temp0:module(param6))
                )
            )
        )
        (send gTheDoits:add(temp0))
    )


    (method (doit)
        (if (not said and not (send gQg3Messager:talkerList))
            = said 1
            (switch (argCount)
                (case 3
                    (send gQg3Messager:say(noun verb case))
                )
                (case 4
                    (send gQg3Messager:say(noun verb case seq))
                )
                (case 5
                    (send gQg3Messager:say(noun verb case seq who))
                )
                (case 6
                    (send gQg3Messager:say(noun verb case seq who module))
                )
            )
            (self:dispose())
        )
    )


    (method (dispose)
        (send gTheDoits:delete(self))
        (super:dispose())
    )

)
(instance qg3Messager of Messager
    (properties)

    (method (say param1)
        (if (== gNewRoomNumber gClientModNum)
            (if (talkerList)
                (MessObj:new(rest param1))
            )(else
                (super:say(rest param1))
            )
        )
    )


    (method (findTalker param1)
        (var temp0)
        = temp0 
            (switch (param1)
                (case 99
                    gNarrator
                )
                (case 7
                    ScriptID(210 1)
                )
                (case 8
                    ScriptID(210 2)
                )
                (case 9
                    ScriptID(210 1)
                )
                (case 10
                    ScriptID(210 2)
                )
                (case 21
                    ScriptID(230 1)
                )
                (case 22
                    ScriptID(232 1)
                )
                (case 23
                    ScriptID(235 1)
                )
                (case 66
                    ScriptID(234 0)
                )
                (case 27
                    ScriptID(245 0)
                )
                (case 26
                    ScriptID(247 0)
                )
                (case 25
                    ScriptID(248 0)
                )
                (case 32
                    ScriptID(246 0)
                )
                (case 33
                    ScriptID(246 1)
                )
                (case 67
                    ScriptID(241 2)
                )
                (case 30
                    ScriptID(250 1)
                )
                (case 28
                    ScriptID(250 2)
                )
                (case 29
                    ScriptID(250 3)
                )
                (case 39
                    ScriptID(360 1)
                )
                (case 72
                    ScriptID(360 2)
                )
                (case 58
                    ScriptID(290 1)
                )
                (case 37
                    ScriptID(300 1)
                )
                (case 36
                    ScriptID(300 2)
                )
                (case 62
                    ScriptID(320 1)
                )
                (case 63
                    ScriptID(320 2)
                )
                (case 64
                    ScriptID(320 3)
                )
                (case 65
                    ScriptID(320 4)
                )
                (case 4
                    ScriptID(330 1)
                )
                (case 18
                    ScriptID(340 1)
                )
                (case 15
                    ScriptID(340 2)
                )
                (case 57
                    ScriptID(340 3)
                )
                (case 16
                    ScriptID(340 4)
                )
                (case 61
                    ScriptID(340 5)
                )
                (case 20
                    ScriptID(241 1)
                )
                (case 38
                    ScriptID(350 1)
                )
                (case 42
                    ScriptID(58 0)
                )
                (case 43
                    ScriptID(58 0)
                )
                (case 59
                    ScriptID(420 1)
                )
                (case 54
                    ScriptID(820 1)
                )
                (case 53
                    ScriptID(850 1)
                )
                (case 13
                    ScriptID(49 0)
                )
                (case 60
                    ScriptID(48 0)
                )
                (case 50
                    ScriptID(43 0)
                )
                (case 49
                    ScriptID(44 0)
                )
                (case 3
                    ScriptID(34 0)
                )
                (case 2
                    ScriptID(35 0)
                )
                (case 48
                    ScriptID(36 0)
                )
                (case 41
                    ScriptID(39 0)
                )
                (case 19
                    ScriptID(40 0)
                )
                (case 40
                    ScriptID(42 0)
                )
                (case 51
                    ScriptID(41 0)
                )
                (case 44
                    ScriptID(53 0)
                )
                (case 46
                    ScriptID(401 1)
                )
                (case 47
                    ScriptID(401 2)
                )
                (case 45
                    ScriptID(402 1)
                )
                (case 6
                    ScriptID(110 1)
                )
                (case 11
                    ScriptID(120 1)
                )
                (case 5
                    ScriptID(100 1)
                )
                (case 24
                    ScriptID(260 1)
                )
                (case 34
                    ScriptID(260 2)
                )
                (case 35
                    ScriptID(260 3)
                )
                (case 31
                    ScriptID(260 4)
                )
                (case 68
                    ScriptID(285 1)
                )
                (case 69
                    ScriptID(285 2)
                )
                (case 52
                    ScriptID(830 1)
                )
                (case 70
                    ScriptID(490 1)
                )
                (case 71
                    ScriptID(830 2)
                )
            )
        (if (temp0)
            return 
        )(else
            (super:findTalker(param1))
        )
    )

)
(class GlorySong of Sound
    (properties
        nodePtr 0
        handle 0
        flags $0000
        number 0
        vol 127
        priority 0
        loop 1
        signal $0000
        prevSignal 0
        dataInc 0
        min 0
        sec 0
        frame 0
        client 0
        owner 0
        change 0
        nextSong 0
        loopTwice 0
        holdVal 0
    )

    (method (check)
        (if (handle)
            DoSound(sndUPDATE_CUES self)
        )
        (if (signal)
            = prevSignal signal
            = signal 0
            (if (change)
                = change 0
                (self:play(vol client))
            )(else
                (if (IsObject(client))
                    (send client:cue(self))
                )
                (if (nextSong and (== prevSignal -1))
                    = number nextSong
                    = nextSong 0
                    (self:
                        setLoop(-1)
                        play(vol)
                    )
                )
                (if (== prevSignal 126)
                    (if (loopTwice)
                        = loopTwice 0
                        (self:play(vol))
                        (if (holdVal)
                            (self:hold(holdVal))
                        )
                    )(else
                        = loopTwice 1
                    )
                )
            )
        )
    )


    (method (changeTo theNumber theClient)
        = number theNumber
        (if (> paramTotal (= change 1))
            = client theClient
        )
    )

)
(instance longSong of GlorySong
    (properties)
)
(instance longSong2 of GlorySong
    (properties)
)
(instance longSong3 of GlorySong
    (properties)
)
(instance public mainIconBar of IconBar
    (properties)

    (method (init)
        (self:
            add(iconLeft iconWalk iconLook iconDo iconTalk iconActions iconCast iconUseIt iconInventory iconControlPanel iconHelp iconRight)
            eachElementDo(110)
            eachElementDo(212 -1)
            eachElementDo(213 -1)
            useIconItem(iconUseIt)
            helpIconItem(iconHelp)
            walkIconItem(iconWalk)
            state(3072)
        )
        (iconHelp:
            view(930)
            loop(9)
        )
    )


    (method (handleEvent pEvent)
        (if (> (send pEvent:y) (self:height))
            (self:hide())
        )
        (super:handleEvent(pEvent))
    )


    (method (show)
        (var temp0, temp1, temp2, temp3, theY, temp5, temp6, temp7)
        (send gSounds:pause())
        = state (| state $0020)
        (send gGame:setCursor(999 1))
        = temp0 (self:at(0))
        = height CelHigh((send temp0:view) (send temp0:loop) (send temp0:cel))
        = port GetPort()
        SetPort(-1)
        = underBits Graph(grSAVE_BOX y 0 (+ y height) 320 1)
        = temp1 PicNotValid()
        PicNotValid(1)
        = temp3 0
        = theY y
        = temp5 FirstNode(elements)
        (while (temp5)
            = temp6 NextNode(temp5)
            = temp7 NodeValue(temp5)
            (if (not IsObject(temp7))
                return 
            )
            (if (<= (send temp7:nsRight) 0)
                (send temp7:show(temp3 theY))
                = temp3 (send temp7:nsRight)
            )(else
                (send temp7:show())
            )
            = temp5 temp6
        )
        (if (curInvIcon)
            (if ((send gOwner:has((send gInv:indexOf(curInvIcon)))))
                = temp3 (+ (/ (- (- (send useIconItem:nsRight) (send useIconItem:nsLeft)) CelWide((send curInvIcon:view) (send curInvIcon:loop) (send curInvIcon:cel))) 2) (send useIconItem:nsLeft))
                = theY (+ (+ y (/ (- (- (send useIconItem:nsBottom) (send useIconItem:nsTop)) CelHigh((send curInvIcon:view) (send curInvIcon:loop) (send curInvIcon:cel))) 2)) (send useIconItem:nsTop))
                DrawCel((send curInvIcon:view) (send curInvIcon:loop) (send curInvIcon:cel) temp3 theY -1)
                (if (& (send useIconItem:signal) $0004)
                    (send useIconItem:mask())
                )
            )(else
                = curInvIcon 0
            )
        )
        PicNotValid(temp1)
        Graph(grUPDATE_BOX y 0 + y height 320 1)
        (self:highlight(curIcon))
    )


    (method (hide)
        (super:hide())
        (if (global449)
            PalVary(pvPAUSE_RESUME 0)
            proc0_5(121)
            = global449 0
        )
    )


    (method (swapCurIcon)
        (var temp0)
        (if (& state $0004)
            return 
        )(else
            (if ((<> curIcon iconWalk) and not (& (iconWalk:signal) $0004))
                = prevIcon curIcon
                = curIcon iconWalk
            )(else
                (if (prevIcon and not (& (send prevIcon:signal) $0004))
                    = curIcon prevIcon
                )
            )
        )
        (send gGame:setCursor((send curIcon:cursor) 1))
    )


    (method (noClickHelp param1)
        (super:noClickHelp(rest param1))
        (if (& (send curIcon:signal) $0004)
            (self:advanceCurIcon())
        )
    )

)
(instance iconLeft of IconI
    (properties
        view 930
        loop 12
        cel 1
        nsTop 0
        cursor 69
    )

    (method (show)
        (super:show(-30 nsTop))
    )


    (method (select)
        return 0
    )


    (method (mask)
    )

)
(instance iconRight of IconI
    (properties
        view 930
        loop 13
        cel 1
        cursor 69
    )

    (method (select)
        return 0
    )


    (method (mask)
    )

)
(instance iconWalk of IconI
    (properties
        view 930
        loop 0
        cel 0
        cursor 940
        type $5000
        message 3
        signal $0041
        maskView 930
        maskLoop 14
        noun 14
        helpVerb 9
    )

    (method (select param1)
        (var temp0)
        return 
            (if ((super:select(rest param1)))
                (send gMainIconBar:hide())
                (send gOwner:changeGait(0 1))
                return 1
            )(else
                return 0
            )
    )

)
(instance iconLook of IconI
    (properties
        view 930
        loop 1
        cel 0
        cursor 941
        message 1
        signal $0041
        maskView 930
        maskLoop 14
        noun 15
        helpVerb 9
    )
)
(instance iconDo of IconI
    (properties
        view 930
        loop 2
        cel 0
        cursor 942
        message 4
        signal $0041
        maskView 930
        maskLoop 14
        noun 16
        helpVerb 9
    )
)
(instance iconTalk of IconI
    (properties
        view 930
        loop 3
        cel 0
        cursor 943
        message 2
        signal $0041
        maskView 930
        maskLoop 14
        noun 17
        helpVerb 9
    )
)
(instance iconActions of IconI
    (properties
        view 930
        loop 10
        cel 0
        cursor 942
        message 7
        signal $0042
        maskView 930
        maskLoop 14
        noun 18
        helpVerb 9
    )

    (method (select param1)
        return 
            (if ((super:select(rest param1)))
                proc0_9()
                (send gMainIconBar:hide())
                (send (ScriptID(20)):
                    init()
                    show()
                )
                return 1
            )(else
                return 0
            )
    )

)
(instance iconCast of IconI
    (properties
        view 930
        loop 11
        cel 0
        message 8
        signal $0043
        maskView 930
        maskLoop 14
        noun 19
        helpVerb 9
    )

    (method (select param1)
        (var temp0, temp1)
        (asm
            pushi   #select
            pushi   0
            &rest   param1
            super   IconI, 4
            bnt     code_2953
            pushi   #cursor
            pushi   0
            pushi   #curIcon
            pushi   0
            lag     gMainIconBar
            send    4
            send    4
            push    
            ldi     948
            ne?     
            bnt     code_2847
            pushi   0
            call    proc0_9, 0
code_2847:  pushi   #hide
            pushi   0
            lag     gMainIconBar
            send    4
            ldi     12
            lagi    gGOwnerMaxStamina
            not     
            bnt     code_286b
            pushi   #say
            pushi   6
            pushi   26
            pushi   6
            pushi   27
            pushi   0
            pushi   0
            pushi   0
            lag     gQg3Messager
            send    16
            jmp     code_294d
code_286b:  pushi   12
            lsg     gClientModNum
            pushi   210
            pushi   240
            pushi   250
            pushi   260
            pushi   270
            pushi   290
            pushi   300
            pushi   320
            pushi   330
            pushi   340
            pushi   360
            calle   proc999_5, 24
            bnt     code_28ae
            pushi   #say
            pushi   6
            pushi   26
            pushi   6
            pushi   24
            pushi   0
            pushi   0
            pushi   0
            lag     gQg3Messager
            send    16
            jmp     code_294d
code_28ae:  pushi   11
            lsg     gClientModNum
            pushi   410
            pushi   420
            pushi   440
            pushi   450
            pushi   460
            pushi   470
            pushi   475
            pushi   480
            pushi   485
            pushi   490
            calle   proc999_5, 22
            bnt     code_28fc
            lsg     gClientModNum
            ldi     450
            eq?     
            bnt     code_28e3
            lag     global121
code_28e3:  not     
            bnt     code_28fc
            pushi   #say
            pushi   6
            pushi   26
            pushi   6
            pushi   25
            pushi   0
            pushi   0
            pushi   0
            lag     gQg3Messager
            send    16
            jmp     code_294d
code_28fc:  ldi     0
            sat     temp1
code_2900:  lst     temp1
            ldi     15
            lt?     
            bnt     code_291b
            pushi   19
            lat     temp1
            add     
            lagi    gGOwnerMaxStamina
            sat     temp0
            bnt     code_2917
            jmp     code_291b
code_2917:  +at     temp1
            jmp     code_2900
code_291b:  lat     temp0
            not     
            bnt     code_2936
            pushi   #say
            pushi   6
            pushi   26
            pushi   6
            pushi   26
            pushi   0
            pushi   0
            pushi   0
            lag     gQg3Messager
            send    16
            jmp     code_294d
code_2936:  pushi   #init
            pushi   0
            pushi   113
            pushi   0
            pushi   111
            pushi   0
            pushi   1
            pushi   21
            callk   ScriptID, 2
            send    12
            pushi   1
            pushi   21
            callk   DisposeScript, 2
code_294d:  ldi     1
            ret     
            jmp     code_2956
code_2953:  ldi     0
            ret     
code_2956:  ret     
        )
    )

)
(instance iconUseIt of IconI
    (properties
        view 930
        loop 4
        cel 0
        cursor 999
        message 0
        signal $0041
        maskView 930
        maskLoop 14
        maskCel 1
        noun 20
        helpVerb 9
    )

    (method (select param1)
        (var newEvent, temp1, gMainIconBarCurInvIcon, temp3, temp4)
        return 
            (if (& signal $0004)
                0
            )(else
                (if ((paramTotal and param1) and (& signal $0001))
                    = gMainIconBarCurInvIcon (send gMainIconBar:curInvIcon)
                    (if (gMainIconBarCurInvIcon)
                        = temp3 (+ (/ (- (- nsRight nsLeft) CelWide((send gMainIconBarCurInvIcon:view) (send gMainIconBarCurInvIcon:loop) (send gMainIconBarCurInvIcon:cel))) 2) nsLeft)
                        = temp4 (+ (+ (send gMainIconBar:y) (/ (- (- nsBottom nsTop) CelHigh((send gMainIconBarCurInvIcon:view) (send gMainIconBarCurInvIcon:loop) (send gMainIconBarCurInvIcon:cel))) 2)) nsTop)
                    )
                    = temp1 1
                    DrawCel(view loop temp1 nsLeft nsTop -1)
                    = gMainIconBarCurInvIcon (send gMainIconBar:curInvIcon)
                    (if (gMainIconBarCurInvIcon)
                        DrawCel((send (= gMainIconBarCurInvIcon (send gMainIconBar:curInvIcon)):view) (send gMainIconBarCurInvIcon:loop) (send gMainIconBarCurInvIcon:cel) temp3 temp4 -1)
                    )
                    Graph(grUPDATE_BOX nsTop nsLeft nsBottom nsRight 1)
                    (while (<> (send ((= newEvent (Event:new()))):type) 2)
                        (send newEvent:localize())
                        (if ((self:onMe(newEvent)))
                            (if (not temp1)
                                = temp1 1
                                DrawCel(view loop temp1 nsLeft nsTop -1)
                                = gMainIconBarCurInvIcon (send gMainIconBar:curInvIcon)
                                (if (gMainIconBarCurInvIcon)
                                    DrawCel((send (= gMainIconBarCurInvIcon (send gMainIconBar:curInvIcon)):view) (send gMainIconBarCurInvIcon:loop) (send gMainIconBarCurInvIcon:cel) temp3 temp4 -1)
                                )
                                Graph(grUPDATE_BOX nsTop nsLeft nsBottom nsRight 1)
                            )
                        )(else
                            (if (temp1)
                                = temp1 0
                                DrawCel(view loop temp1 nsLeft nsTop -1)
                                = gMainIconBarCurInvIcon (send gMainIconBar:curInvIcon)
                                (if (gMainIconBarCurInvIcon)
                                    DrawCel((send (= gMainIconBarCurInvIcon (send gMainIconBar:curInvIcon)):view) (send gMainIconBarCurInvIcon:loop) (send gMainIconBarCurInvIcon:cel) temp3 temp4 -1)
                                )
                                Graph(grUPDATE_BOX nsTop nsLeft nsBottom nsRight 1)
                            )
                        )
                        (send newEvent:dispose())
                    )
                    (send newEvent:dispose())
                    (if (== temp1 1)
                        DrawCel(view loop 0 nsLeft nsTop -1)
                        = gMainIconBarCurInvIcon (send gMainIconBar:curInvIcon)
                        (if (gMainIconBarCurInvIcon)
                            DrawCel((send (= gMainIconBarCurInvIcon (send gMainIconBar:curInvIcon)):view) (send gMainIconBarCurInvIcon:loop) (send gMainIconBarCurInvIcon:cel) temp3 temp4 -1)
                        )
                        Graph(grUPDATE_BOX nsTop nsLeft nsBottom nsRight 1)
                    )
                    temp1
                )(else
                    1
                )
            )
    )

)
(instance iconInventory of IconI
    (properties
        view 930
        loop 5
        cel 0
        cursor 999
        type $0000
        message 0
        signal $0043
        maskView 930
        maskLoop 14
        noun 21
        helpVerb 9
    )

    (method (select param1)
        (var temp0)
        return 
            (if ((super:select(rest param1)))
                (send gMainIconBar:hide())
                (send (ScriptID(16 1)):init(gOwner))
                return 1
            )(else
                return 0
            )
    )

)
(instance iconControlPanel of IconI
    (properties
        view 930
        loop 7
        cel 0
        cursor 999
        message 9
        signal $0043
        maskView 930
        maskLoop 14
        noun 22
        helpVerb 9
    )

    (method (select param1)
        return 
            (if ((super:select(rest param1)))
                (send gMainIconBar:hide())
                (send (ScriptID(25)):
                    init()
                    show()
                    dispose()
                )
                DisposeScript(25)
                DisposeScript(19)
                return 1
            )(else
                return 0
            )
    )

)
(instance iconHelp of IconI
    (properties
        view 930
        loop 9
        cel 0
        cursor 949
        message 9
        signal $0003
        maskView 930
        maskLoop 14
        noun 23
        helpVerb 9
    )
)
(instance public textIcon of IconI
    (properties
        view 935
        loop 2
        cel 0
    )

    (method (new param1 param2 param3 param4 param5)
        (var temp0, temp1, temp2)
        = temp0 Clone(self)
        (if (paramTotal)
            = temp1 Message(2 param5 param1 param2 param3 param4)
            (send temp0:message(Memory(2 temp1)))
            Message(0 param5 param1 param2 param3 param4 (send temp0:message))
        )
        return temp0
    )


    (method (dispose)
        Memory(3 message)
        (super:dispose())
    )


    (method (show)
        = nsRight (+ nsLeft 
            (if (== loop 1)
                0
            )(else
                60
            )
)
        = nsBottom 
            (if (== loop 1)
                nsTop
            )(else
                (+ nsTop 15)
            )
        DrawCel(view loop cel nsLeft nsTop -1)
        Display(message 100 
            (if (== loop 1)
                nsLeft
            )(else
                + nsLeft 20
            )
 + nsTop 2 105 
            (if (== loop 1)
                123
            )(else
                0
            )
 102 17 101 modifiers 106 
            (if (== loop 1)
                189
            )(else
                40
            )
)
    )


    (method (select)
        return 
            (if (<> loop 1)
                = gCursor cursor
                (send gNewGameControls:state((& (send gNewGameControls:state) $ffdf)))
            )(else
                return 0
            )
    )


    (method (highlight param1)
        (var temp0)
        (if (<> loop 1)
            (if (param1)
                DrawCel(view loop 1 nsLeft nsTop -1)
                = temp0 46
            )(else
                DrawCel(view loop 0 nsLeft nsTop -1)
                = temp0 17
            )
            Display(message 100 
                (if (== loop 1)
                    nsLeft
                )(else
                    + nsLeft 20
                )
 + nsTop 2 105 
                (if (== loop 1)
                    123
                )(else
                    0
                )
 102 temp0 101 modifiers 106 
                (if (== loop 1)
                    189
                )(else
                    40
                )
)
        )
    )

)
