(version 2)
(include "sci.sh")
(exports
    0 glorySpells
)
(use "Main")
(use "GloryWindow")
(use "Print")
(use "IconI")
(use "InvI")
(use "Obj")
(script 21)



(class SpellItem of InvI
    (properties
        view 0
        loop 0
        cel 0
        nsLeft 0
        nsTop 0
        nsRight 0
        nsBottom 0
        state $0000
        cursor 999
        type $4000
        message 0
        modifiers $0000
        signal $0002
        maskView 0
        maskLoop 0
        maskCel 0
        highlightColor 0
        lowlightColor 0
        noun 0
        modNum 0
        helpVerb 0
        owner 0
        script 0
        value 0
    )

    (method (select)
        (asm
            pushi   #view
            pushi   0
            lag     gOwner
            send    4
            push    
            ldi     17
            gt?     
            bnt     code_0112
            pushi   #view
            pushi   0
            lag     gOwner
            send    4
            push    
            ldi     21
            lt?     
            bnt     code_0112
            jmp     code_0110
code_0110:  bt      code_011b
code_0112:  pTos    value
            ldi     18
            lagi    gGOwnerMaxStamina
            lt?     
            bnt     code_0125
code_011b:  pushi   #doVerb
            pushi   1
            pushi   4
            self    6
            jmp     code_0139
code_0125:  pushi   #addText
            pushi   7
            pushi   0
            pushi   0
            pushi   2
            pushi   1
            pushi   0
            pushi   0
            pushi   21
            pushi   110
            pushi   0
            class   Print
            send    22
code_0139:  ldi     0
            ret     
        )
    )


    (method (doVerb theVerb)
        (var temp0[20], temp20[80])
        (switch (theVerb)
            (case 1
                Message(0 21 noun 0 1 1 @temp0)
                Message(0 21 0 0 3 1 @temp20)
                (Print:
                    addTextF(@temp20 @temp0 value gGOwnerMaxStamina[+ 19 (glorySpells:indexOf(self))])
                    init()
                )
            )
        )
    )

)
(instance spellsLook of IconI
    (properties
        view 932
        loop 2
        cel 0
        cursor 941
        message 1
        signal $0081
        noun 1
        modNum 21
        helpVerb 9
    )
)
(instance spellsSelect of IconI
    (properties
        view 932
        loop 0
        cel 0
        cursor 942
        noun 4
        modNum 21
        helpVerb 9
    )
)
(instance ok of IconI
    (properties
        view 932
        loop 3
        cel 0
        cursor 999
        signal $0043
        noun 2
        modNum 21
        helpVerb 9
    )
)
(instance spellsHelp of IconI
    (properties
        view 932
        loop 1
        cel 0
        cursor 949
        message 9
        noun 3
        modNum 21
        helpVerb 9
    )

    (method (show)
        (super:show())
        DrawCel(932 7 0 - (+ nsLeft CelWide(view loop cel)) 28 nsTop -1)
    )

)
(instance public glorySpells of Inv
    (properties
        normalHeading 9
        empty 27
    )

    (method (init)
        (var temp0)
        (self:
            add(openSpell detectMagicSpell triggerSpell dazzleSpell zapSpell calmSpell flameDartSpell fetchSpell forceBoltSpell levitateSpell reversalSpell jugglingLightsSpell summonStaffSpell lightningBallSpell healingSpell spellsLook spellsSelect ok spellsHelp dummyIcon)
            eachElementDo(212 -1)
            eachElementDo(213 -1)
            eachElementDo(110)
            window(spellWin)
            helpIconItem(spellsHelp)
            selectIcon(spellsSelect)
            okButton(ok)
            state(2048)
        )
        = temp0 0
        (while (< temp0 15)
            (if (gGOwnerMaxStamina[+ 19 temp0])
                (send ((self:at(temp0))):owner(gOwner))
            )
            ++temp0
        )
        (if (>= 
        (if (< 
        (if (gGGOwnerMaxStamina_3)
            (- gGOwnerMaxStamina[14] gGGOwnerMaxStamina_3)
        )
 0)
            0
        )(else
            (if (gGGOwnerMaxStamina_3)
                (- gGOwnerMaxStamina[14] gGGOwnerMaxStamina_3)
            )
        )
 25)
            (healingSpell:owner(gOwner))
        )
    )


    (method (hide)
        (dummyIcon:owner(0))
        (super:hide())
    )


    (method (advance)
        (var temp0, temp1)
        (asm
            ldi     1
            sat     temp1
code_02ae:  lst     temp1
            pToa    size
            le?     
            bnt     code_0303
            pushi   64
            pushi   1
            lst     temp1
            pushi   #indexOf
            pushi   1
            pTos    highlightedIcon
            self    6
            add     
            push    
            pToa    size
            mod     
            push    
            self    6
            sat     temp0
            pushi   1
            push    
            callk   IsObject, 2
            not     
            bnt     code_02e0
            pushi   1
            pushi   #first
            pushi   0
            self    4
            push    
            callk   NodeValue, 2
            sat     temp0
code_02e0:  lst     temp0
            lofsa   dummyIcon
            ne?     
            bnt     code_02f6
            pushi   #signal
            pushi   0
            lat     temp0
            send    4
            push    
            ldi     4
            and     
            not     
            bnt     code_02f6
code_02f6:  lst     temp1
            ldi     1
            add     
            push    
            pToa    size
            mod     
            sat     temp1
            jmp     code_02ae
code_0303:  pushi   218
            pushi   #view
            lst     temp0
            pTos    state
            ldi     32
            and     
            push    
            self    8
            ret     
        )
    )


    (method (retreat)
        (var temp0, temp1)
        (asm
            ldi     1
            sat     temp1
code_0318:  lst     temp1
            pToa    size
            le?     
            bnt     code_036e
            pushi   64
            pushi   1
            pushi   #indexOf
            pushi   1
            pTos    highlightedIcon
            self    6
            push    
            lat     temp1
            sub     
            push    
            pToa    size
            mod     
            push    
            self    6
            sat     temp0
            pushi   1
            push    
            callk   IsObject, 2
            not     
            bnt     code_034b
            pushi   1
            pushi   #last
            pushi   0
            self    4
            push    
            callk   NodeValue, 2
            sat     temp0
code_034b:  lst     temp0
            lofsa   dummyIcon
            ne?     
            bnt     code_0361
            pushi   #signal
            pushi   0
            lat     temp0
            send    4
            push    
            ldi     4
            and     
            not     
            bnt     code_0361
code_0361:  lst     temp1
            ldi     1
            add     
            push    
            pToa    size
            mod     
            sat     temp1
            jmp     code_0318
code_036e:  pushi   218
            pushi   #view
            lst     temp0
            pTos    state
            ldi     32
            and     
            push    
            self    8
            ret     
        )
    )


    (method (noClickHelp)
        (var temp0, temp1, temp2, temp3, gGloryWindowEraseOnly)
        = temp2 0
        = temp1 temp2
        = temp3 GetPort()
        = gGloryWindowEraseOnly (send gGloryWindow:eraseOnly)
        (send gGloryWindow:eraseOnly(1))
        (while (not (send (= temp0 (send ((send gUser:curEvent)):new())):type))
            (if (not (self:isMemberOf(IconBar)))
                (send temp0:localize())
            )
            = temp2 (self:firstTrue(#onMe temp0))
            (if (temp2)
                (if ((<> (= temp2 (self:firstTrue(#onMe temp0))) temp1) and (send temp2:helpVerb))
                    = temp1 temp2
                    (if (gDialog)
                        (send gDialog:dispose())
                    )
                    (Print:
                        font(gFont)
                        width(250)
                        addText((send temp2:noun) (send temp2:helpVerb) 0 1 0 0 (send temp2:modNum))
                        modeless(1)
                        init()
                    )
                    SetPort(temp3)
                )
            )(else
                (if (gDialog)
                    (send gDialog:dispose())
                )(else
                    = temp1 0
                )
            )
            (send temp0:dispose())
        )
        (send gGloryWindow:eraseOnly(gGloryWindowEraseOnly))
        (send gGame:setCursor(942 1))
        (if (gDialog)
            (send gDialog:dispose())
        )
        SetPort(temp3)
    )


    (method (drawInvWindow param1 param2)
        (var temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, invFirst, temp9, temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17, temp18, temp19, temp20, temp21, invWindow, temp23[70])
        = temp5 0
        = temp4 temp5
        = temp3 temp4
        = temp2 temp3
        = temp1 temp2
        = temp0 temp1
        = invFirst (self:first())
        (while (invFirst)
            = temp9 NodeValue(invFirst)
            (if ((send temp9:isKindOf(SpellItem)))
                (if ((send temp9:ownedBy(param1)))
                    (send temp9:signal((& (send temp9:signal) $fffb)))
                    ++temp0
                    = temp6 CelWide((send temp9:view) (send temp9:loop) (send temp9:cel))
                    (if (> temp6 temp2)
                        = temp2 temp6
                    )
                    = temp7 CelHigh((send temp9:view) (send temp9:loop) (send temp9:cel))
                    (if (> temp7 temp1)
                        = temp1 temp7
                    )
                )(else
                    (send temp9:signal((| (send temp9:signal) $0004)))
                )
            )(else
                ++temp3
                = temp5 (+ temp5 CelWide((send temp9:view) (send temp9:loop) (send temp9:cel)))
                = temp7 CelHigh((send temp9:view) (send temp9:loop) (send temp9:cel))
                (if (> temp7 temp4)
                    = temp4 temp7
                )
            )
            = invFirst (self:next(invFirst))
        )
        (if (not temp0)
            return 0
        )
        (if (<= temp0 5)
            = temp17 1
            = temp11 temp0
        )(else
            = temp17 Sqrt(temp0)
            (if ((> temp17 1) and (>= (* temp17 temp17) temp0))
                --temp17
            )
            (if (> temp17 3)
                = temp17 3
            )
            = temp11 (/ temp0 temp17)
            (if (<= (* temp17 temp11) temp0)
                ++temp11
            )
            (if (> temp17 1)
                (if (> temp11 8)
                    = temp11 8
                )(else
                    (if (< temp11 5)
                        = temp11 5
                    )
                )
            )
            (if (== (* temp11 (- temp17 1)) temp0)
                --temp17
            )
        )
        = temp12 proc999_3((+ 4 temp5) (* temp11 (+ 6 temp2)))
        = temp10 (* temp17 (+ 4 temp1))
        = temp13 (/ (- 190 temp10) 2)
        = temp14 (/ (- 320 temp12) 2)
        = temp15 (+ temp13 temp10)
        = temp16 (+ temp14 temp12)
        = invWindow (self:window)
        (if (invWindow)
            (send (= invWindow (self:window)):
                top(temp13)
                left(temp14)
                right(temp16)
                bottom(temp15)
                open()
            )
        )
        = temp21 temp11
        (if (temp0)
            = temp19 (+ 2 
                (if ((send invWindow:respondsTo(#yOffset)))
                    (send invWindow:yOffset)
                )(else
                    0
                )
)
            = temp18 (+ 8 
                (if ((send invWindow:respondsTo(#xOffset)))
                    (send invWindow:xOffset)
                )(else
                    0
                )
)
            = temp20 temp18
            = invFirst (self:first())
            (while (invFirst)
                = temp9 NodeValue(invFirst)
                (if (not (& (send temp9:signal) $0004) and (send temp9:isKindOf(SpellItem)))
                    (if (not & (send temp9:signal) $0080)
                        = temp6 CelWide((send temp9:view) (send temp9:loop) (send temp9:cel))
                        = temp7 CelHigh((send temp9:view) (send temp9:loop) (send temp9:cel))
                        (send temp9:
                            nsLeft(+ temp18 (/ (- temp2 temp7) 2))
                            nsTop(+ temp19 (/ (- temp1 temp7) 2))
                        )
                        (send temp9:
                            nsRight(+ (send temp9:nsLeft) temp6)
                            nsBottom(+ (send temp9:nsTop) temp7)
                        )
                        (if (--temp21)
                            = temp18 (+ temp18 (+ temp2 4))
                        )(else
                            = temp21 temp11
                            = temp19 (+ temp19 (+ temp1 2))
                            = temp18 temp20
                        )
                    )(else
                        = temp18 (send temp9:nsLeft)
                        = temp19 (send temp9:nsTop)
                    )
                    (send temp9:show())
                    (if (== temp9 param2)
                        (send temp9:highlight())
                    )
                )
                = invFirst (self:next(invFirst))
            )
        )
        = temp18 (/ (- (- (send invWindow:right) (send invWindow:left)) temp5) 2)
        = temp10 (- (send invWindow:bottom) (send invWindow:top))
        = temp19 32767
        = invFirst (self:first())
        (while (invFirst)
            = temp9 NodeValue(invFirst)
            (if (not (send temp9:isKindOf(SpellItem)))
                = temp6 CelWide((send temp9:view) (send temp9:loop) (send temp9:cel))
                = temp7 CelHigh((send temp9:view) (send temp9:loop) (send temp9:cel))
                (if (not & (send temp9:signal) $0080)
                    (if (== temp19 32767)
                        = temp19 (- temp10 temp7)
                    )
                    (send temp9:
                        nsLeft(temp18)
                        nsTop(temp19)
                        nsBottom(temp10)
                        nsRight(+ temp18 temp6)
                    )
                )
                = temp18 (+ (send temp9:nsLeft) temp6)
                = temp19 (send temp9:nsTop)
                (send temp9:
                    signal(& (send temp9:signal) $fffb)
                    show()
                )
            )
            = invFirst (self:next(invFirst))
        )
        (dummyIcon:
            nsTop(0)
            nsLeft(0)
            nsRight((send window:right))
            nsBottom((send window:bottom))
            owner(param1)
            signal(2)
        )
        return 1
    )

)
(instance spellWin of GloryWindow
    (properties
        yOffset 28
    )

    (method (open)
        (spellsLook:nsLeft((- (/ (- (self:right) (self:left)) 2) 60)))
        (super:open())
    )

)
(instance dummyIcon of SpellItem
    (properties
        view 932
        cursor 942
    )

    (method (show)
        = owner gOwner
    )


    (method (select)
        return 0
    )


    (method (highlight)
    )


    (method (onMe param1)
        return 
            (if (((>= (send param1:x) nsLeft) and (>= (send param1:y) nsTop)) and (<= (send param1:x) nsRight))
                <= (send param1:y) nsBottom
            )(else
                0
            )
    )


    (method (doVerb)
        return 0
    )

)
(instance openSpell of SpellItem
    (properties
        view 906
        cursor 938
        noun 5
        value 2
    )

    (method (doVerb theVerb)
        (var temp0)
        (switch (theVerb)
            (case 4
                (glorySpells:hide())
                (if (proc999_5(gClientModNum 230 310 380 430 450 640 650 700 810 820 853))
                    (send ((send gMainIconBar:at(6))):
                        message(75)
                        cursor(948)
                    )
                    (send gMainIconBar:curIcon((send gMainIconBar:at(6))))
                )(else
                    (if (> (send gOwner:view) 5)
                        (send gQg3Messager:say(0 0 14 1 0 21))
                    )(else
                        (send gOwner:setScript(ScriptID(13)))
                    )
                )
            )
            (case 1
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance detectMagicSpell of SpellItem
    (properties
        view 906
        cel 1
        cursor 938
        noun 6
        value 2
    )

    (method (doVerb theVerb)
        (var newEvent)
        return 
            (switch (theVerb)
                (case 4
                    (glorySpells:hide())
                    (if (proc999_5(gClientModNum 230 280 310 390 430 650 770 780 810 853))
                        = newEvent (Event:new())
                        (send newEvent:
                            type(1)
                            message(76)
                        )
                        (if (not (send gQg3MDHandler:handleEvent(newEvent)))
                            (send gRegions:handleEvent(newEvent))
                        )
                        (send newEvent:dispose())
                        return 1
                    )(else
                        (if (> (send gOwner:view) 5)
                            (send gQg3Messager:say(0 0 14 1 0 21))
                        )(else
                            (send gOwner:setScript(ScriptID(12) 0 76))
                        )
                    )
                )
                (case 1
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance triggerSpell of SpellItem
    (properties
        view 906
        cel 2
        cursor 938
        noun 7
        value 3
    )

    (method (doVerb theVerb)
        (var newEvent)
        return 
            (switch (theVerb)
                (case 4
                    (glorySpells:hide())
                    (if (proc999_5(gClientModNum 230 280 310 400 430 650 700 850 851 852 853 854))
                        = newEvent (Event:new())
                        (send newEvent:
                            type(1)
                            message(77)
                        )
                        (if (not (send gQg3MDHandler:handleEvent(newEvent)))
                            (send gRegions:handleEvent(newEvent))
                        )
                        (send newEvent:dispose())
                        return 1
                    )(else
                        (if (> (send gOwner:view) 5)
                            (send gQg3Messager:say(0 0 14 1 0 21))
                        )(else
                            (send gOwner:setScript(ScriptID(12) 0 77))
                        )
                    )
                )
                (case 1
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance dazzleSpell of SpellItem
    (properties
        view 906
        cel 3
        cursor 938
        noun 8
        value 3
    )

    (method (doVerb theVerb)
        (var newEvent)
        return 
            (switch (theVerb)
                (case 4
                    (glorySpells:hide())
                    (if (proc999_5(gClientModNum 230 280 310 400 430 650 700 851 852 853 854))
                        = newEvent (Event:new())
                        (send newEvent:
                            type(1)
                            message(78)
                        )
                        (if (not (send gQg3MDHandler:handleEvent(newEvent)))
                            (send gRegions:handleEvent(newEvent))
                        )
                        (send newEvent:dispose())
                        return 1
                    )(else
                        (if (> (send gOwner:view) 5)
                            (send gQg3Messager:say(0 0 14 1 0 21))
                        )(else
                            (send gOwner:setScript(ScriptID(12) 0 78))
                        )
                    )
                )
                (case 1
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance zapSpell of SpellItem
    (properties
        view 906
        cel 4
        cursor 938
        noun 9
        value 3
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 4
                (glorySpells:hide())
                (if (== gClientModNum 650)
                    (send global2:doVerb(79))
                )(else
                    = global142 (+ 5 (/ gGOwnerMaxStamina[23] 10))
                    (if ((send gOwner:has(1)) or (send gOwner:has(2)))
                        (send gQg3Messager:say(0 0 8 1 0 21))
                    )(else
                        (send gQg3Messager:say(0 0 9 1 0 21))
                    )
                )
            )
            (case 1
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance calmSpell of SpellItem
    (properties
        view 906
        cel 5
        cursor 938
        noun 10
        value 4
    )

    (method (doVerb theVerb)
        (var newEvent)
        return 
            (switch (theVerb)
                (case 4
                    (glorySpells:hide())
                    (if (proc999_5(gClientModNum 230 280 310 390 400 430 450 630 650 700 820 850 851 852 853 854))
                        = newEvent (Event:new())
                        (send newEvent:
                            type(1)
                            message(80)
                        )
                        (if (not (send gQg3MDHandler:handleEvent(newEvent)))
                            (send gRegions:handleEvent(newEvent))
                        )
                        (send newEvent:dispose())
                        return 1
                    )(else
                        (if (> (send gOwner:view) 5)
                            (send gQg3Messager:say(0 0 14 1 0 21))
                        )(else
                            (send gOwner:setScript(ScriptID(12) 0 80))
                        )
                    )
                )
                (case 1
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance flameDartSpell of SpellItem
    (properties
        view 906
        cel 6
        cursor 938
        noun 11
        value 5
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 4
                (glorySpells:hide())
                (send ((send gMainIconBar:at(6))):
                    message(81)
                    cursor(948)
                )
                (send gMainIconBar:curIcon((send gMainIconBar:at(6))))
            )
            (case 1
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance fetchSpell of SpellItem
    (properties
        view 906
        cel 7
        cursor 938
        noun 12
        value 5
    )

    (method (doVerb theVerb)
        (var temp0)
        (switch (theVerb)
            (case 4
                (glorySpells:hide())
                (send ((send gMainIconBar:at(6))):
                    message(82)
                    cursor(948)
                )
                (send gMainIconBar:curIcon((send gMainIconBar:at(6))))
            )
            (case 1
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance forceBoltSpell of SpellItem
    (properties
        view 906
        cel 8
        cursor 938
        noun 13
        value 6
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 4
                (glorySpells:hide())
                (send ((send gMainIconBar:at(6))):
                    message(83)
                    cursor(948)
                )
                (send gMainIconBar:curIcon((send gMainIconBar:at(6))))
            )
            (case 1
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance levitateSpell of SpellItem
    (properties
        view 906
        cel 9
        cursor 938
        noun 14
        value 7
    )

    (method (doVerb theVerb)
        (var newEvent)
        return 
            (switch (theVerb)
                (case 4
                    (glorySpells:hide())
                    (if (proc999_5(gClientModNum 280 310 400 430 650 700 720 740 851 852 853 854))
                        = newEvent (Event:new())
                        (send newEvent:
                            type(1)
                            message(84)
                        )
                        (if (not (send gQg3MDHandler:handleEvent(newEvent)))
                            (send gRegions:handleEvent(newEvent))
                        )
                        (send newEvent:dispose())
                        return 1
                    )(else
                        (if (> (send gOwner:view) 5)
                            (send gQg3Messager:say(0 0 14 1 0 21))
                        )(else
                            (if ((send (ScriptID(gClientModNum)):script))
                                (send gQg3Messager:say(0 0 15 0 0 21))
                            )(else
                                (send gQg3Messager:say(21 6 21 0 0 21))
                            )
                        )
                    )
                )
                (case 1
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance reversalSpell of SpellItem
    (properties
        view 906
        cel 10
        cursor 938
        noun 15
        value 8
    )

    (method (doVerb theVerb)
        (var newEvent)
        return 
            (switch (theVerb)
                (case 4
                    (glorySpells:hide())
                    (if (proc999_5(gClientModNum 280 310 400 430 650 700 850 853))
                        = newEvent (Event:new())
                        (send newEvent:
                            type(1)
                            message(85)
                        )
                        (if (not (send gQg3MDHandler:handleEvent(newEvent)))
                            (send gRegions:handleEvent(newEvent))
                        )
                        (send newEvent:dispose())
                        return 1
                    )(else
                        (Print:
                            addText(0 0 13 1 0 0 21)
                            init()
                        )
                    )
                )
                (case 1
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance jugglingLightsSpell of SpellItem
    (properties
        view 906
        cel 11
        cursor 938
        noun 16
        value 8
    )

    (method (doVerb theVerb)
        (var newEvent)
        return 
            (switch (theVerb)
                (case 4
                    (glorySpells:hide())
                    (if (proc999_5(gClientModNum 230 280 310 400 430 650 700 853))
                        = newEvent (Event:new())
                        (send newEvent:
                            type(1)
                            message(86)
                        )
                        (if (not (send gQg3MDHandler:handleEvent(newEvent)))
                            (send gRegions:handleEvent(newEvent))
                        )
                        (send newEvent:dispose())
                        return 1
                    )(else
                        (send gOwner:setScript(ScriptID(62 0)))
                    )
                )
                (case 1
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance summonStaffSpell of SpellItem
    (properties
        view 906
        cel 12
        cursor 938
        noun 17
        value 5
    )

    (method (doVerb theVerb)
        (var newEvent)
        return 
            (switch (theVerb)
                (case 4
                    (glorySpells:hide())
                    (if (proc0_6(69))
                        (if (proc999_5(gClientModNum 280 310 400 430 650 700 850 853))
                            = newEvent (Event:new())
                            (send newEvent:
                                type(1)
                                message(87)
                            )
                            (if (not (send gQg3MDHandler:handleEvent(newEvent)))
                                (send gRegions:handleEvent(newEvent))
                            )
                            (send newEvent:dispose())
                            return 1
                        )
                    )(else
                        (send gQg3Messager:say(21 6 18 0 0 21))
                    )
                )
                (case 1
                    (super:doVerb(theVerb))
                )
            )
    )

)
(instance lightningBallSpell of SpellItem
    (properties
        view 906
        cel 13
        cursor 938
        noun 18
        value 10
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 4
                (glorySpells:hide())
                (send ((send gMainIconBar:at(6))):
                    message(88)
                    cursor(948)
                )
                (send gMainIconBar:curIcon((send gMainIconBar:at(6))))
            )
            (case 1
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance healingSpell of SpellItem
    (properties
        view 906
        cel 14
        cursor 938
        noun 20
        value 10
    )

    (method (select)
        (if (< gGOwnerMaxStamina[17] 10)
            (Print:
                addText(21 6 20 1 0 0 21)
                init()
            )
        )(else
            (self:doVerb(4))
        )
        return 0
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 1
                (Print:
                    addText(noun theVerb 0 1 0 0 21)
                    init()
                )
            )
            (case 4
                (glorySpells:hide())
                (send ((send gMainIconBar:at(6))):
                    message(66)
                    cursor(948)
                )
                (send gMainIconBar:curIcon((send gMainIconBar:at(6))))
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
