VERSION 5.00
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Begin VB.Form SpellEditor 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Spell Editor"
   ClientHeight    =   4665
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6855
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   311
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   457
   StartUpPosition =   3  'Windows Default
   Begin VB.ComboBox CBDifficulty 
      Height          =   315
      Left            =   4320
      Style           =   2  'Dropdown List
      TabIndex        =   21
      Top             =   1680
      Width           =   2415
   End
   Begin VB.ComboBox CBResult 
      Height          =   315
      Left            =   4320
      Style           =   2  'Dropdown List
      TabIndex        =   20
      Top             =   2760
      Width           =   2415
   End
   Begin VB.ComboBox CBType 
      Height          =   315
      Left            =   4320
      Style           =   2  'Dropdown List
      TabIndex        =   19
      Top             =   2400
      Width           =   2415
   End
   Begin VB.TextBox Result 
      Height          =   285
      Left            =   3480
      TabIndex        =   18
      Top             =   2760
      Width           =   735
   End
   Begin VB.TextBox SpellType 
      Height          =   285
      Left            =   3480
      TabIndex        =   17
      Top             =   2400
      Width           =   735
   End
   Begin VB.TextBox Skill 
      Height          =   285
      Left            =   3480
      TabIndex        =   16
      Top             =   2040
      Width           =   735
   End
   Begin VB.TextBox Difficulty 
      Height          =   285
      Left            =   3480
      TabIndex        =   15
      Top             =   1680
      Width           =   735
   End
   Begin VB.TextBox Rune4 
      Height          =   285
      Left            =   6000
      TabIndex        =   10
      Top             =   960
      Width           =   735
   End
   Begin VB.TextBox Rune3 
      Height          =   285
      Left            =   5160
      TabIndex        =   9
      Top             =   960
      Width           =   735
   End
   Begin VB.TextBox Rune2 
      Height          =   285
      Left            =   4320
      TabIndex        =   8
      Top             =   960
      Width           =   735
   End
   Begin VB.ComboBox CBSkill 
      Height          =   315
      Left            =   4320
      Style           =   2  'Dropdown List
      TabIndex        =   7
      Top             =   2040
      Width           =   2415
   End
   Begin VB.TextBox Fatigue 
      Height          =   285
      Left            =   3480
      TabIndex        =   1
      Top             =   1320
      Width           =   735
   End
   Begin VB.TextBox Rune1 
      Height          =   285
      Left            =   3480
      TabIndex        =   0
      Top             =   960
      Width           =   735
   End
   Begin VB.Label ST 
      Alignment       =   1  'Right Justify
      Caption         =   "result:"
      Height          =   255
      Index           =   5
      Left            =   2400
      TabIndex        =   14
      Top             =   2760
      Width           =   975
   End
   Begin VB.Label ST 
      Alignment       =   1  'Right Justify
      Caption         =   "type:"
      Height          =   255
      Index           =   4
      Left            =   2400
      TabIndex        =   13
      Top             =   2400
      Width           =   975
   End
   Begin VB.Label ST 
      Alignment       =   1  'Right Justify
      Caption         =   "skill:"
      Height          =   255
      Index           =   3
      Left            =   2400
      TabIndex        =   12
      Top             =   2040
      Width           =   975
   End
   Begin VB.Label ST 
      Alignment       =   1  'Right Justify
      Caption         =   "difficulty:"
      Height          =   255
      Index           =   2
      Left            =   2400
      TabIndex        =   11
      Top             =   1680
      Width           =   975
   End
   Begin VB.Label ST 
      Alignment       =   1  'Right Justify
      Caption         =   "runes:"
      Height          =   255
      Index           =   0
      Left            =   2400
      TabIndex        =   6
      Top             =   960
      Width           =   975
   End
   Begin MSForms.ListBox SpellList 
      Height          =   3975
      Left            =   120
      TabIndex        =   5
      Top             =   120
      Width           =   2160
      ScrollBars      =   3
      DisplayStyle    =   2
      Size            =   "3810;7011"
      ColumnCount     =   2
      cColumnInfo     =   1
      MatchEntry      =   0
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
      Object.Width           =   "987"
   End
   Begin MSForms.CommandButton Ok 
      Default         =   -1  'True
      Height          =   375
      Left            =   120
      TabIndex        =   4
      Top             =   4200
      Width           =   1335
      Caption         =   "Ok"
      Size            =   "2355;661"
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
      ParagraphAlign  =   3
   End
   Begin MSForms.CommandButton Cancel 
      Cancel          =   -1  'True
      Height          =   375
      Left            =   5400
      TabIndex        =   3
      Top             =   4200
      Width           =   1335
      Caption         =   "Cancel"
      Size            =   "2355;661"
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
      ParagraphAlign  =   3
   End
   Begin VB.Label ST 
      Alignment       =   1  'Right Justify
      Caption         =   "fatigue:"
      Height          =   255
      Index           =   1
      Left            =   2400
      TabIndex        =   2
      Top             =   1320
      Width           =   975
   End
End
Attribute VB_Name = "SpellEditor"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Spells(25) As New Spell
Public selectedSpell As Integer
Public subchange As Boolean

Public Function init()
    Dim i As Integer
    
    SpellList.Clear
    
    For i = 1 To 25
        Spells(i).Difficulty = App.graphics.f560.Spell(i).Difficulty
        Spells(i).Rune1 = App.graphics.f560.Spell(i).Rune1
        Spells(i).Rune2 = App.graphics.f560.Spell(i).Rune2
        Spells(i).Rune3 = App.graphics.f560.Spell(i).Rune3
        Spells(i).Rune4 = App.graphics.f560.Spell(i).Rune4
        Spells(i).Skill = App.graphics.f560.Spell(i).Skill
        Spells(i).word6 = App.graphics.f560.Spell(i).word6
        
        SpellList.AddItem
        modifiedspell (i)
    Next
    
    CBSkill.Clear
    CBSkill.AddItem "00 - Fighter 1"
    CBSkill.AddItem "01 - Ninja 1"
    CBSkill.AddItem "02 - Priest 1"
    CBSkill.AddItem "03 - Wizard 1"
    CBSkill.AddItem "04 - Fighter 2"
    CBSkill.AddItem "05 - Fighter 3"
    CBSkill.AddItem "06 - Fighter 4"
    CBSkill.AddItem "07 - Fighter 5"
    CBSkill.AddItem "08 - Ninja 2"
    CBSkill.AddItem "09 - Ninja 3"
    CBSkill.AddItem "10 - Ninja 4"
    CBSkill.AddItem "11 - Ninja 5"
    CBSkill.AddItem "12 - Priest 2"
    CBSkill.AddItem "13 - Priest 3"
    CBSkill.AddItem "14 - Priest 4"
    CBSkill.AddItem "15 - Priest 5"
    CBSkill.AddItem "16 - Wizard 2"
    CBSkill.AddItem "17 - Wizard 3"
    CBSkill.AddItem "18 - Wizard 4"
    CBSkill.AddItem "19 - Wizard 5"
    
    CBType.Clear
    CBType.AddItem ("00 Unknown")
    CBType.AddItem ("01 Needs a Flask")
    CBType.AddItem ("02 Missile Launcher")
    CBType.AddItem ("03 Durational")
    CBType.AddItem ("04 Unknown")
    CBType.AddItem ("05 Unknown")
    CBType.AddItem ("06 Unknown")
    CBType.AddItem ("07 Unknown")
    CBType.AddItem ("08 Unknown")
    CBType.AddItem ("09 Unknown")
    CBType.AddItem ("10 Unknown")
    CBType.AddItem ("11 Unknown")
    CBType.AddItem ("12 Unknown")
    CBType.AddItem ("13 Unknown")
    CBType.AddItem ("14 Unknown")
    CBType.AddItem ("15 Unknown")
    
    CBDifficulty.Clear
    CBDifficulty.AddItem "---"
    CBDifficulty.AddItem "neophyte"
    CBDifficulty.AddItem "novice"
    CBDifficulty.AddItem "apprentice"
    CBDifficulty.AddItem "journeyman"
    CBDifficulty.AddItem "craftsman"
    CBDifficulty.AddItem "artisan"
    CBDifficulty.AddItem "adept"
    CBDifficulty.AddItem "expert"
    CBDifficulty.AddItem "l1 master"
    CBDifficulty.AddItem "l2 master"
    CBDifficulty.AddItem "l3 master"
    CBDifficulty.AddItem "l4 master"
    CBDifficulty.AddItem "l5 master"
    CBDifficulty.AddItem "l6 master"
    CBDifficulty.AddItem "archmaster"
    
    selectSpell (1)
End Function

Public Function modifiedspell(ByVal num As Integer)

    SpellList.List(num - 1, 0) = zerostr(num - 1, 2)
    SpellList.List(num - 1, 1) = Spells(num).tostring
    
End Function
Public Function selectSpell(ByVal num As Integer)
    selectedSpell = num

    SpellList.ListIndex = selectedSpell - 1
    Rune1.Text = Str(Spells(num).Rune1)
    Rune2.Text = Str(Spells(num).Rune2)
    Rune3.Text = Str(Spells(num).Rune3)
    Rune4.Text = Str(Spells(num).Rune4)
    
    Fatigue.Text = Str(Spells(num).Fatigue)
    Difficulty.Text = Str(Spells(num).Difficulty)
    Skill.Text = Str(Spells(num).Skill)
    SpellType.Text = Str(Spells(num).SpellType)
    Result.Text = Str(Spells(num).Result)
    
    If Spells(selectedSpell).Difficulty > 15 Then
        CBDifficulty.ListIndex = 15
    Else
        CBDifficulty.ListIndex = Spells(selectedSpell).Difficulty
    End If
    
    CBType.ListIndex = Spells(num).SpellType
    selectspelltype (Spells(num).SpellType)
    
    CBResult.ListIndex = Spells(num).Result
    If Spells(num).Skill >= 0 And Spells(num).Skill < 20 Then
        CBSkill.ListIndex = Spells(num).Skill
    Else
        CBSkill.ListIndex = 0
    End If
    
    
End Function


Private Sub selectspelltype(num As Integer)
    Dim old As Long
    old = CBResult.ListIndex
    CBResult.Clear
    If num = 1 Then
        ' needs a flask
        CBResult.AddItem ("00 Mon Potion A")
        CBResult.AddItem ("01 Um Potion")
        CBResult.AddItem ("02 Des Potion")
        CBResult.AddItem ("03 Ven Potion")
        CBResult.AddItem ("04 Sar Potion")
        CBResult.AddItem ("05 Zo Potion")
        CBResult.AddItem ("06 Ros Potion")
        CBResult.AddItem ("07 Ku Potion")
        CBResult.AddItem ("08 Dane Potion")
        CBResult.AddItem ("09 Neta Potion")
        CBResult.AddItem ("10 Antivenom Potion")
        CBResult.AddItem ("11 Mon Potion B")
        CBResult.AddItem ("12 Ya Potion")
        CBResult.AddItem ("13 EE Potion")
        CBResult.AddItem ("14 Vi Potion")
        CBResult.AddItem ("15 Water Flask")
        CBResult.AddItem ("16 Kath Bomb")
        CBResult.AddItem ("17 Pew Bomb")
        CBResult.AddItem ("18 Ra Bomb")
        CBResult.AddItem ("19 Full Bomb")
        CBResult.AddItem ("20 Empty Flask")
        CBResult.AddItem ("21 Unknown")
        CBResult.AddItem ("22 Unknown")
        CBResult.AddItem ("23 Unknown")
        CBResult.AddItem ("24 Unknown")
        CBResult.AddItem ("25 Unknown")
        CBResult.AddItem ("26 Unknown")
        CBResult.AddItem ("27 Unknown")
        CBResult.AddItem ("28 Unknown")
        CBResult.AddItem ("29 Unknown")
        CBResult.AddItem ("30 Unknown")
        CBResult.AddItem ("31 Unknown")
        CBResult.AddItem ("32 Unknown")
        CBResult.AddItem ("33 Unknown")
        CBResult.AddItem ("34 Unknown")
        CBResult.AddItem ("35 Unknown")
        CBResult.AddItem ("36 Unknown")
        CBResult.AddItem ("37 Unknown")
        CBResult.AddItem ("38 Unknown")
        CBResult.AddItem ("39 Unknown")
        CBResult.AddItem ("40 Unknown")
        CBResult.AddItem ("41 Unknown")
        CBResult.AddItem ("42 Unknown")
        CBResult.AddItem ("43 Unknown")
        CBResult.AddItem ("44 Unknown")
        CBResult.AddItem ("45 Unknown")
        CBResult.AddItem ("46 Unknown")
        CBResult.AddItem ("47 Unknown")
        CBResult.AddItem ("48 Unknown")
        CBResult.AddItem ("49 Unknown")
        CBResult.AddItem ("50 Unknown")
        CBResult.AddItem ("51 Unknown")
        CBResult.AddItem ("52 Unknown")
        CBResult.AddItem ("53 Unknown")
        CBResult.AddItem ("54 Unknown")
        CBResult.AddItem ("55 Unknown")
        CBResult.AddItem ("56 Unknown")
        CBResult.AddItem ("57 Unknown")
        CBResult.AddItem ("58 Unknown")
        CBResult.AddItem ("59 Unknown")
        CBResult.AddItem ("60 Unknown")
        CBResult.AddItem ("61 Unknown")
        CBResult.AddItem ("62 Unknown")
        CBResult.AddItem ("63 Unknown")
  
    ElseIf num = 2 Then
        'Missile Launcher
        CBResult.AddItem ("00 Fireball")
        CBResult.AddItem ("01 Poison Blob?")
        CBResult.AddItem ("02 Lightning")
        CBResult.AddItem ("03 Dispel")
        CBResult.AddItem ("04 Zo Spell")
        CBResult.AddItem ("05 Unknown")
        CBResult.AddItem ("06 Poison Bolt")
        CBResult.AddItem ("07 Poison Cloud")
        CBResult.AddItem ("08 Unknown")
        CBResult.AddItem ("09 Unknown")
        CBResult.AddItem ("10 Unknown")
        CBResult.AddItem ("11 Unknown")
        CBResult.AddItem ("12 Unknown")
        CBResult.AddItem ("13 Unknown")
        CBResult.AddItem ("14 Unknown")
        CBResult.AddItem ("15 Unknown")
        CBResult.AddItem ("16 Unknown")
        CBResult.AddItem ("17 Unknown")
        CBResult.AddItem ("18 Unknown")
        CBResult.AddItem ("19 Unknown")
        CBResult.AddItem ("20 Unknown")
        CBResult.AddItem ("21 Unknown")
        CBResult.AddItem ("22 Unknown")
        CBResult.AddItem ("23 Unknown")
        CBResult.AddItem ("24 Unknown")
        CBResult.AddItem ("25 Unknown")
        CBResult.AddItem ("26 Unknown")
        CBResult.AddItem ("27 Unknown")
        CBResult.AddItem ("28 Unknown")
        CBResult.AddItem ("29 Unknown")
        CBResult.AddItem ("30 Unknown")
        CBResult.AddItem ("31 Unknown")
        CBResult.AddItem ("32 Unknown")
        CBResult.AddItem ("33 Unknown")
        CBResult.AddItem ("34 Unknown")
        CBResult.AddItem ("35 Unknown")
        CBResult.AddItem ("36 Unknown")
        CBResult.AddItem ("37 Unknown")
        CBResult.AddItem ("38 Unknown")
        CBResult.AddItem ("39 Unknown")
        CBResult.AddItem ("40 Unknown")
        CBResult.AddItem ("41 Unknown")
        CBResult.AddItem ("42 Unknown")
        CBResult.AddItem ("43 Unknown")
        CBResult.AddItem ("44 Unknown")
        CBResult.AddItem ("45 Unknown")
        CBResult.AddItem ("46 Unknown")
        CBResult.AddItem ("47 Unknown")
        CBResult.AddItem ("48 Unknown")
        CBResult.AddItem ("49 Unknown")
        CBResult.AddItem ("50 Unknown")
        CBResult.AddItem ("51 Unknown")
        CBResult.AddItem ("52 Unknown")
        CBResult.AddItem ("53 Unknown")
        CBResult.AddItem ("54 Unknown")
        CBResult.AddItem ("55 Unknown")
        CBResult.AddItem ("56 Unknown")
        CBResult.AddItem ("57 Unknown")
        CBResult.AddItem ("58 Unknown")
        CBResult.AddItem ("59 Unknown")
        CBResult.AddItem ("60 Unknown")
        CBResult.AddItem ("61 Unknown")
        CBResult.AddItem ("62 Unknown")
        CBResult.AddItem ("63 Unknown")
        
    ElseIf num = 3 Then
        'durational
        CBResult.AddItem ("00 Powerful Light")
        CBResult.AddItem ("01 Darkness")
        CBResult.AddItem ("02 See Through Walls")
        CBResult.AddItem ("03 Invisability")
        CBResult.AddItem ("04 Magic Shield")
        CBResult.AddItem ("05 Light")
        CBResult.AddItem ("06 Magic Footprints")
        CBResult.AddItem ("07 Create Item ZoKathRa")
        CBResult.AddItem ("08 Fire Shield")
        CBResult.AddItem ("09 Unknown")
        CBResult.AddItem ("10 Unknown")
        CBResult.AddItem ("11 Unknown")
        CBResult.AddItem ("12 Unknown")
        CBResult.AddItem ("13 Unknown")
        CBResult.AddItem ("14 Unknown")
        CBResult.AddItem ("15 Unknown")
        CBResult.AddItem ("16 Unknown")
        CBResult.AddItem ("17 Unknown")
        CBResult.AddItem ("18 Unknown")
        CBResult.AddItem ("19 Unknown")
        CBResult.AddItem ("20 Unknown")
        CBResult.AddItem ("21 Unknown")
        CBResult.AddItem ("22 Unknown")
        CBResult.AddItem ("23 Unknown")
        CBResult.AddItem ("24 Unknown")
        CBResult.AddItem ("25 Unknown")
        CBResult.AddItem ("26 Unknown")
        CBResult.AddItem ("27 Unknown")
        CBResult.AddItem ("28 Unknown")
        CBResult.AddItem ("29 Unknown")
        CBResult.AddItem ("30 Unknown")
        CBResult.AddItem ("31 Unknown")
        CBResult.AddItem ("32 Unknown")
        CBResult.AddItem ("33 Unknown")
        CBResult.AddItem ("34 Unknown")
        CBResult.AddItem ("35 Unknown")
        CBResult.AddItem ("36 Unknown")
        CBResult.AddItem ("37 Unknown")
        CBResult.AddItem ("38 Unknown")
        CBResult.AddItem ("39 Unknown")
        CBResult.AddItem ("40 Unknown")
        CBResult.AddItem ("41 Unknown")
        CBResult.AddItem ("42 Unknown")
        CBResult.AddItem ("43 Unknown")
        CBResult.AddItem ("44 Unknown")
        CBResult.AddItem ("45 Unknown")
        CBResult.AddItem ("46 Unknown")
        CBResult.AddItem ("47 Unknown")
        CBResult.AddItem ("48 Unknown")
        CBResult.AddItem ("49 Unknown")
        CBResult.AddItem ("50 Unknown")
        CBResult.AddItem ("51 Unknown")
        CBResult.AddItem ("52 Unknown")
        CBResult.AddItem ("53 Unknown")
        CBResult.AddItem ("54 Unknown")
        CBResult.AddItem ("55 Unknown")
        CBResult.AddItem ("56 Unknown")
        CBResult.AddItem ("57 Unknown")
        CBResult.AddItem ("58 Unknown")
        CBResult.AddItem ("59 Unknown")
        CBResult.AddItem ("60 Unknown")
        CBResult.AddItem ("61 Unknown")
        CBResult.AddItem ("62 Unknown")
        CBResult.AddItem ("63 Unknown")

    Else
    
        CBResult.AddItem ("00 Unknown")
        CBResult.AddItem ("01 Unknown")
        CBResult.AddItem ("02 Unknown")
        CBResult.AddItem ("03 Unknown")
        CBResult.AddItem ("04 Unknown")
        CBResult.AddItem ("05 Unknown")
        CBResult.AddItem ("06 Unknown")
        CBResult.AddItem ("07 Unknown")
        CBResult.AddItem ("08 Unknown")
        CBResult.AddItem ("09 Unknown")
        CBResult.AddItem ("10 Unknown")
        CBResult.AddItem ("11 Unknown")
        CBResult.AddItem ("12 Unknown")
        CBResult.AddItem ("13 Unknown")
        CBResult.AddItem ("14 Unknown")
        CBResult.AddItem ("15 Unknown")
        CBResult.AddItem ("16 Unknown")
        CBResult.AddItem ("17 Unknown")
        CBResult.AddItem ("18 Unknown")
        CBResult.AddItem ("19 Unknown")
        CBResult.AddItem ("20 Unknown")
        CBResult.AddItem ("21 Unknown")
        CBResult.AddItem ("22 Unknown")
        CBResult.AddItem ("23 Unknown")
        CBResult.AddItem ("24 Unknown")
        CBResult.AddItem ("25 Unknown")
        CBResult.AddItem ("26 Unknown")
        CBResult.AddItem ("27 Unknown")
        CBResult.AddItem ("28 Unknown")
        CBResult.AddItem ("29 Unknown")
        CBResult.AddItem ("30 Unknown")
        CBResult.AddItem ("31 Unknown")
        CBResult.AddItem ("32 Unknown")
        CBResult.AddItem ("33 Unknown")
        CBResult.AddItem ("34 Unknown")
        CBResult.AddItem ("35 Unknown")
        CBResult.AddItem ("36 Unknown")
        CBResult.AddItem ("37 Unknown")
        CBResult.AddItem ("38 Unknown")
        CBResult.AddItem ("39 Unknown")
        CBResult.AddItem ("40 Unknown")
        CBResult.AddItem ("41 Unknown")
        CBResult.AddItem ("42 Unknown")
        CBResult.AddItem ("43 Unknown")
        CBResult.AddItem ("44 Unknown")
        CBResult.AddItem ("45 Unknown")
        CBResult.AddItem ("46 Unknown")
        CBResult.AddItem ("47 Unknown")
        CBResult.AddItem ("48 Unknown")
        CBResult.AddItem ("49 Unknown")
        CBResult.AddItem ("50 Unknown")
        CBResult.AddItem ("51 Unknown")
        CBResult.AddItem ("52 Unknown")
        CBResult.AddItem ("53 Unknown")
        CBResult.AddItem ("54 Unknown")
        CBResult.AddItem ("55 Unknown")
        CBResult.AddItem ("56 Unknown")
        CBResult.AddItem ("57 Unknown")
        CBResult.AddItem ("58 Unknown")
        CBResult.AddItem ("59 Unknown")
        CBResult.AddItem ("60 Unknown")
        CBResult.AddItem ("61 Unknown")
        CBResult.AddItem ("62 Unknown")
        CBResult.AddItem ("63 Unknown")
        
    End If
    CBResult.ListIndex = old
End Sub

Private Sub CBDifficulty_Change()
    'Difficulty.Text = Str(CBDifficulty.ListIndex)
End Sub

Private Sub CBDifficulty_Click()

    Difficulty.Text = Str(CBDifficulty.ListIndex)
End Sub

Private Sub CBResult_Click()

    Result.Text = Str(CBResult.ListIndex)
End Sub

Private Sub CBSkill_Click()

    Skill.Text = Str(CBSkill.ListIndex)
End Sub

Private Sub CBType_Click()

    SpellType.Text = Str(CBType.ListIndex)
End Sub

Private Sub Rune1_Change()
    If subchange = True Then
        Exit Sub
    End If
    subchange = True
    Spells(selectedSpell).Rune1 = App.EFChange8(Rune1, 0, 255)
    modifiedspell (selectedSpell)
    subchange = False
End Sub
Private Sub Rune2_Change()
    If subchange = True Then
        Exit Sub
    End If
    subchange = True
    Spells(selectedSpell).Rune2 = App.EFChange8(Rune2, 0, 255)
    modifiedspell (selectedSpell)
    subchange = False
End Sub
Private Sub Rune3_Change()
    If subchange = True Then
        Exit Sub
    End If
    subchange = True
    Spells(selectedSpell).Rune3 = App.EFChange8(Rune3, 0, 255)
    modifiedspell (selectedSpell)
    subchange = False
End Sub
Private Sub Rune4_Change()
    If subchange = True Then
        Exit Sub
    End If
    subchange = True
    Spells(selectedSpell).Rune4 = App.EFChange8(Rune4, 0, 255)
    modifiedspell (selectedSpell)
    subchange = False
End Sub

Private Sub Fatigue_Change()
    If subchange = True Then
        Exit Sub
    End If
    subchange = True
    Spells(selectedSpell).setfatigue (App.EFChange8(Fatigue, 0, 63))
    subchange = False
End Sub
Private Sub Difficulty_Change()
    If subchange = True Then
        Exit Sub
    End If
    subchange = True
    Spells(selectedSpell).Difficulty = App.EFChange8(Difficulty, 0, 255)
    If Spells(selectedSpell).Difficulty > 15 Then
        CBDifficulty.ListIndex = 15
    Else
        CBDifficulty.ListIndex = Spells(selectedSpell).Difficulty
    End If
    subchange = False
End Sub
Private Sub Skill_Change()
    If subchange = True Then
        Exit Sub
    End If
    subchange = True
    Spells(selectedSpell).Skill = App.EFChange8(Skill, 0, 19) 'fixme
    If Spells(selectedSpell).Skill >= 0 And Spells(selectedSpell).Skill < 20 Then
        CBSkill.ListIndex = Spells(selectedSpell).Skill
    Else
        CBSkill.ListIndex = 15
    End If
    subchange = False
End Sub
Private Sub SpellType_Change()
    If subchange = True Then
        Exit Sub
    End If
    subchange = True
    Spells(selectedSpell).setspelltype (App.EFChange8(SpellType, 0, 15))
    CBType.ListIndex = Spells(selectedSpell).SpellType
    selectspelltype (Spells(selectedSpell).SpellType)
    subchange = False
End Sub
Private Sub Result_Change()
    If subchange = True Then
        Exit Sub
    End If
    subchange = True
    Spells(selectedSpell).setresult (App.EFChange8(Result, 0, 63))
    CBResult.ListIndex = Spells(selectedSpell).Result
    subchange = False
End Sub
Private Sub Cancel_Click()
    Hide
    
End Sub


Private Sub SpellList_Click()
    selectSpell (SpellList.ListIndex + 1)
End Sub


Private Sub Ok_Click()
    For i = 1 To 25
        App.graphics.f560.Spell(i).Difficulty = Spells(i).Difficulty
        App.graphics.f560.Spell(i).Rune1 = Spells(i).Rune1
        App.graphics.f560.Spell(i).Rune2 = Spells(i).Rune2
        App.graphics.f560.Spell(i).Rune3 = Spells(i).Rune3
        App.graphics.f560.Spell(i).Rune4 = Spells(i).Rune4
        App.graphics.f560.Spell(i).Skill = Spells(i).Skill
        App.graphics.f560.Spell(i).word6 = Spells(i).word6
    Next
    App.graphics.f560.update
    Hide
End Sub



