Option Strict Off
Option Explicit On
Friend Class SpellEditor
	Inherits System.Windows.Forms.Form
	'UPGRADE_WARNING: Arrays can't be declared with New. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC9D3AE5-6B95-4B43-91C7-28276302A5E8"'
    Private Spells() As spell = ADGEDotNetUt.ArrayUt(Of spell).NewArray1(25)
	Public selectedSpell As Short
	Public subchange As Boolean
	
    Public Sub init()
        Dim i As Short

        SpellList.Items.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.Items.Add("").SubItems.Add("")
            modifiedspell(i)
        Next

        CBSkill.Items.Clear()
        CBSkill.Items.Add("00 - Fighter 1")
        CBSkill.Items.Add("01 - Ninja 1")
        CBSkill.Items.Add("02 - Priest 1")
        CBSkill.Items.Add("03 - Wizard 1")
        CBSkill.Items.Add("04 - Fighter 2")
        CBSkill.Items.Add("05 - Fighter 3")
        CBSkill.Items.Add("06 - Fighter 4")
        CBSkill.Items.Add("07 - Fighter 5")
        CBSkill.Items.Add("08 - Ninja 2")
        CBSkill.Items.Add("09 - Ninja 3")
        CBSkill.Items.Add("10 - Ninja 4")
        CBSkill.Items.Add("11 - Ninja 5")
        CBSkill.Items.Add("12 - Priest 2")
        CBSkill.Items.Add("13 - Priest 3")
        CBSkill.Items.Add("14 - Priest 4")
        CBSkill.Items.Add("15 - Priest 5")
        CBSkill.Items.Add("16 - Wizard 2")
        CBSkill.Items.Add("17 - Wizard 3")
        CBSkill.Items.Add("18 - Wizard 4")
        CBSkill.Items.Add("19 - Wizard 5")

        CBType.Items.Clear()
        CBType.Items.Add(("00 Unknown"))
        CBType.Items.Add(("01 Needs a Flask"))
        CBType.Items.Add(("02 Missile Launcher"))
        CBType.Items.Add(("03 Durational"))
        CBType.Items.Add(("04 Unknown"))
        CBType.Items.Add(("05 Unknown"))
        CBType.Items.Add(("06 Unknown"))
        CBType.Items.Add(("07 Unknown"))
        CBType.Items.Add(("08 Unknown"))
        CBType.Items.Add(("09 Unknown"))
        CBType.Items.Add(("10 Unknown"))
        CBType.Items.Add(("11 Unknown"))
        CBType.Items.Add(("12 Unknown"))
        CBType.Items.Add(("13 Unknown"))
        CBType.Items.Add(("14 Unknown"))
        CBType.Items.Add(("15 Unknown"))

        CBDifficulty.Items.Clear()
        CBDifficulty.Items.Add("---")
        CBDifficulty.Items.Add("neophyte")
        CBDifficulty.Items.Add("novice")
        CBDifficulty.Items.Add("apprentice")
        CBDifficulty.Items.Add("journeyman")
        CBDifficulty.Items.Add("craftsman")
        CBDifficulty.Items.Add("artisan")
        CBDifficulty.Items.Add("adept")
        CBDifficulty.Items.Add("expert")
        CBDifficulty.Items.Add("l1 master")
        CBDifficulty.Items.Add("l2 master")
        CBDifficulty.Items.Add("l3 master")
        CBDifficulty.Items.Add("l4 master")
        CBDifficulty.Items.Add("l5 master")
        CBDifficulty.Items.Add("l6 master")
        CBDifficulty.Items.Add("archmaster")

        selectSpell(1)
    End Sub
	
    Public Sub modifiedspell(ByVal num As Short)

        'UPGRADE_WARNING: Couldn't resolve default property of object SpellList.List(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        SpellList.Items(num - 1).Text = zerostr(num - 1, 2)
        'UPGRADE_WARNING: Couldn't resolve default property of object SpellList.List(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
        SpellList.Items(num - 1).SubItems(1).Text = Spells(num).tostring_Renamed()

    End Sub
    Public Sub selectSpell(ByVal num As Short)
        selectedSpell = num

        SpellList.Items(selectedSpell - 1).Focused = True
        MyUt.CheckSel(SpellList, selectedSpell - 1, "BlueGem")
        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.SelectedIndex = 15
        Else
            CBDifficulty.SelectedIndex = Spells(selectedSpell).Difficulty
        End If

        CBType.SelectedIndex = Spells(num).SpellType
        selectspelltype((Spells(num).SpellType))

        CBResult.SelectedIndex = Spells(num).Result
        If Spells(num).Skill >= 0 And Spells(num).Skill < 20 Then
            CBSkill.SelectedIndex = Spells(num).Skill
        Else
            CBSkill.SelectedIndex = 0
        End If


    End Sub
	
	
	Private Sub selectspelltype(ByRef num As Short)
		Dim old As Integer
		old = CBResult.SelectedIndex
		CBResult.Items.Clear()
		If num = 1 Then
			' needs a flask
			CBResult.Items.Add(("00 Mon Potion A"))
			CBResult.Items.Add(("01 Um Potion"))
			CBResult.Items.Add(("02 Des Potion"))
			CBResult.Items.Add(("03 Ven Potion"))
			CBResult.Items.Add(("04 Sar Potion"))
			CBResult.Items.Add(("05 Zo Potion"))
			CBResult.Items.Add(("06 Ros Potion"))
			CBResult.Items.Add(("07 Ku Potion"))
			CBResult.Items.Add(("08 Dane Potion"))
			CBResult.Items.Add(("09 Neta Potion"))
			CBResult.Items.Add(("10 Antivenom Potion"))
			CBResult.Items.Add(("11 Mon Potion B"))
			CBResult.Items.Add(("12 Ya Potion"))
			CBResult.Items.Add(("13 EE Potion"))
			CBResult.Items.Add(("14 Vi Potion"))
			CBResult.Items.Add(("15 Water Flask"))
			CBResult.Items.Add(("16 Kath Bomb"))
			CBResult.Items.Add(("17 Pew Bomb"))
			CBResult.Items.Add(("18 Ra Bomb"))
			CBResult.Items.Add(("19 Full Bomb"))
			CBResult.Items.Add(("20 Empty Flask"))
			CBResult.Items.Add(("21 Unknown"))
			CBResult.Items.Add(("22 Unknown"))
			CBResult.Items.Add(("23 Unknown"))
			CBResult.Items.Add(("24 Unknown"))
			CBResult.Items.Add(("25 Unknown"))
			CBResult.Items.Add(("26 Unknown"))
			CBResult.Items.Add(("27 Unknown"))
			CBResult.Items.Add(("28 Unknown"))
			CBResult.Items.Add(("29 Unknown"))
			CBResult.Items.Add(("30 Unknown"))
			CBResult.Items.Add(("31 Unknown"))
			CBResult.Items.Add(("32 Unknown"))
			CBResult.Items.Add(("33 Unknown"))
			CBResult.Items.Add(("34 Unknown"))
			CBResult.Items.Add(("35 Unknown"))
			CBResult.Items.Add(("36 Unknown"))
			CBResult.Items.Add(("37 Unknown"))
			CBResult.Items.Add(("38 Unknown"))
			CBResult.Items.Add(("39 Unknown"))
			CBResult.Items.Add(("40 Unknown"))
			CBResult.Items.Add(("41 Unknown"))
			CBResult.Items.Add(("42 Unknown"))
			CBResult.Items.Add(("43 Unknown"))
			CBResult.Items.Add(("44 Unknown"))
			CBResult.Items.Add(("45 Unknown"))
			CBResult.Items.Add(("46 Unknown"))
			CBResult.Items.Add(("47 Unknown"))
			CBResult.Items.Add(("48 Unknown"))
			CBResult.Items.Add(("49 Unknown"))
			CBResult.Items.Add(("50 Unknown"))
			CBResult.Items.Add(("51 Unknown"))
			CBResult.Items.Add(("52 Unknown"))
			CBResult.Items.Add(("53 Unknown"))
			CBResult.Items.Add(("54 Unknown"))
			CBResult.Items.Add(("55 Unknown"))
			CBResult.Items.Add(("56 Unknown"))
			CBResult.Items.Add(("57 Unknown"))
			CBResult.Items.Add(("58 Unknown"))
			CBResult.Items.Add(("59 Unknown"))
			CBResult.Items.Add(("60 Unknown"))
			CBResult.Items.Add(("61 Unknown"))
			CBResult.Items.Add(("62 Unknown"))
			CBResult.Items.Add(("63 Unknown"))
			
		ElseIf num = 2 Then 
			'Missile Launcher
			CBResult.Items.Add(("00 Fireball"))
			CBResult.Items.Add(("01 Poison Blob?"))
			CBResult.Items.Add(("02 Lightning"))
			CBResult.Items.Add(("03 Dispel"))
			CBResult.Items.Add(("04 Zo Spell"))
			CBResult.Items.Add(("05 Unknown"))
			CBResult.Items.Add(("06 Poison Bolt"))
			CBResult.Items.Add(("07 Poison Cloud"))
			CBResult.Items.Add(("08 Unknown"))
			CBResult.Items.Add(("09 Unknown"))
			CBResult.Items.Add(("10 Unknown"))
			CBResult.Items.Add(("11 Unknown"))
			CBResult.Items.Add(("12 Unknown"))
			CBResult.Items.Add(("13 Unknown"))
			CBResult.Items.Add(("14 Unknown"))
			CBResult.Items.Add(("15 Unknown"))
			CBResult.Items.Add(("16 Unknown"))
			CBResult.Items.Add(("17 Unknown"))
			CBResult.Items.Add(("18 Unknown"))
			CBResult.Items.Add(("19 Unknown"))
			CBResult.Items.Add(("20 Unknown"))
			CBResult.Items.Add(("21 Unknown"))
			CBResult.Items.Add(("22 Unknown"))
			CBResult.Items.Add(("23 Unknown"))
			CBResult.Items.Add(("24 Unknown"))
			CBResult.Items.Add(("25 Unknown"))
			CBResult.Items.Add(("26 Unknown"))
			CBResult.Items.Add(("27 Unknown"))
			CBResult.Items.Add(("28 Unknown"))
			CBResult.Items.Add(("29 Unknown"))
			CBResult.Items.Add(("30 Unknown"))
			CBResult.Items.Add(("31 Unknown"))
			CBResult.Items.Add(("32 Unknown"))
			CBResult.Items.Add(("33 Unknown"))
			CBResult.Items.Add(("34 Unknown"))
			CBResult.Items.Add(("35 Unknown"))
			CBResult.Items.Add(("36 Unknown"))
			CBResult.Items.Add(("37 Unknown"))
			CBResult.Items.Add(("38 Unknown"))
			CBResult.Items.Add(("39 Unknown"))
			CBResult.Items.Add(("40 Unknown"))
			CBResult.Items.Add(("41 Unknown"))
			CBResult.Items.Add(("42 Unknown"))
			CBResult.Items.Add(("43 Unknown"))
			CBResult.Items.Add(("44 Unknown"))
			CBResult.Items.Add(("45 Unknown"))
			CBResult.Items.Add(("46 Unknown"))
			CBResult.Items.Add(("47 Unknown"))
			CBResult.Items.Add(("48 Unknown"))
			CBResult.Items.Add(("49 Unknown"))
			CBResult.Items.Add(("50 Unknown"))
			CBResult.Items.Add(("51 Unknown"))
			CBResult.Items.Add(("52 Unknown"))
			CBResult.Items.Add(("53 Unknown"))
			CBResult.Items.Add(("54 Unknown"))
			CBResult.Items.Add(("55 Unknown"))
			CBResult.Items.Add(("56 Unknown"))
			CBResult.Items.Add(("57 Unknown"))
			CBResult.Items.Add(("58 Unknown"))
			CBResult.Items.Add(("59 Unknown"))
			CBResult.Items.Add(("60 Unknown"))
			CBResult.Items.Add(("61 Unknown"))
			CBResult.Items.Add(("62 Unknown"))
			CBResult.Items.Add(("63 Unknown"))
			
		ElseIf num = 3 Then 
			'durational
			CBResult.Items.Add(("00 Powerful Light"))
			CBResult.Items.Add(("01 Darkness"))
			CBResult.Items.Add(("02 See Through Walls"))
			CBResult.Items.Add(("03 Invisability"))
			CBResult.Items.Add(("04 Magic Shield"))
			CBResult.Items.Add(("05 Light"))
			CBResult.Items.Add(("06 Magic Footprints"))
			CBResult.Items.Add(("07 Create Item ZoKathRa"))
			CBResult.Items.Add(("08 Fire Shield"))
			CBResult.Items.Add(("09 Unknown"))
			CBResult.Items.Add(("10 Unknown"))
			CBResult.Items.Add(("11 Unknown"))
			CBResult.Items.Add(("12 Unknown"))
			CBResult.Items.Add(("13 Unknown"))
			CBResult.Items.Add(("14 Unknown"))
			CBResult.Items.Add(("15 Unknown"))
			CBResult.Items.Add(("16 Unknown"))
			CBResult.Items.Add(("17 Unknown"))
			CBResult.Items.Add(("18 Unknown"))
			CBResult.Items.Add(("19 Unknown"))
			CBResult.Items.Add(("20 Unknown"))
			CBResult.Items.Add(("21 Unknown"))
			CBResult.Items.Add(("22 Unknown"))
			CBResult.Items.Add(("23 Unknown"))
			CBResult.Items.Add(("24 Unknown"))
			CBResult.Items.Add(("25 Unknown"))
			CBResult.Items.Add(("26 Unknown"))
			CBResult.Items.Add(("27 Unknown"))
			CBResult.Items.Add(("28 Unknown"))
			CBResult.Items.Add(("29 Unknown"))
			CBResult.Items.Add(("30 Unknown"))
			CBResult.Items.Add(("31 Unknown"))
			CBResult.Items.Add(("32 Unknown"))
			CBResult.Items.Add(("33 Unknown"))
			CBResult.Items.Add(("34 Unknown"))
			CBResult.Items.Add(("35 Unknown"))
			CBResult.Items.Add(("36 Unknown"))
			CBResult.Items.Add(("37 Unknown"))
			CBResult.Items.Add(("38 Unknown"))
			CBResult.Items.Add(("39 Unknown"))
			CBResult.Items.Add(("40 Unknown"))
			CBResult.Items.Add(("41 Unknown"))
			CBResult.Items.Add(("42 Unknown"))
			CBResult.Items.Add(("43 Unknown"))
			CBResult.Items.Add(("44 Unknown"))
			CBResult.Items.Add(("45 Unknown"))
			CBResult.Items.Add(("46 Unknown"))
			CBResult.Items.Add(("47 Unknown"))
			CBResult.Items.Add(("48 Unknown"))
			CBResult.Items.Add(("49 Unknown"))
			CBResult.Items.Add(("50 Unknown"))
			CBResult.Items.Add(("51 Unknown"))
			CBResult.Items.Add(("52 Unknown"))
			CBResult.Items.Add(("53 Unknown"))
			CBResult.Items.Add(("54 Unknown"))
			CBResult.Items.Add(("55 Unknown"))
			CBResult.Items.Add(("56 Unknown"))
			CBResult.Items.Add(("57 Unknown"))
			CBResult.Items.Add(("58 Unknown"))
			CBResult.Items.Add(("59 Unknown"))
			CBResult.Items.Add(("60 Unknown"))
			CBResult.Items.Add(("61 Unknown"))
			CBResult.Items.Add(("62 Unknown"))
			CBResult.Items.Add(("63 Unknown"))
			
		Else
			
			CBResult.Items.Add(("00 Unknown"))
			CBResult.Items.Add(("01 Unknown"))
			CBResult.Items.Add(("02 Unknown"))
			CBResult.Items.Add(("03 Unknown"))
			CBResult.Items.Add(("04 Unknown"))
			CBResult.Items.Add(("05 Unknown"))
			CBResult.Items.Add(("06 Unknown"))
			CBResult.Items.Add(("07 Unknown"))
			CBResult.Items.Add(("08 Unknown"))
			CBResult.Items.Add(("09 Unknown"))
			CBResult.Items.Add(("10 Unknown"))
			CBResult.Items.Add(("11 Unknown"))
			CBResult.Items.Add(("12 Unknown"))
			CBResult.Items.Add(("13 Unknown"))
			CBResult.Items.Add(("14 Unknown"))
			CBResult.Items.Add(("15 Unknown"))
			CBResult.Items.Add(("16 Unknown"))
			CBResult.Items.Add(("17 Unknown"))
			CBResult.Items.Add(("18 Unknown"))
			CBResult.Items.Add(("19 Unknown"))
			CBResult.Items.Add(("20 Unknown"))
			CBResult.Items.Add(("21 Unknown"))
			CBResult.Items.Add(("22 Unknown"))
			CBResult.Items.Add(("23 Unknown"))
			CBResult.Items.Add(("24 Unknown"))
			CBResult.Items.Add(("25 Unknown"))
			CBResult.Items.Add(("26 Unknown"))
			CBResult.Items.Add(("27 Unknown"))
			CBResult.Items.Add(("28 Unknown"))
			CBResult.Items.Add(("29 Unknown"))
			CBResult.Items.Add(("30 Unknown"))
			CBResult.Items.Add(("31 Unknown"))
			CBResult.Items.Add(("32 Unknown"))
			CBResult.Items.Add(("33 Unknown"))
			CBResult.Items.Add(("34 Unknown"))
			CBResult.Items.Add(("35 Unknown"))
			CBResult.Items.Add(("36 Unknown"))
			CBResult.Items.Add(("37 Unknown"))
			CBResult.Items.Add(("38 Unknown"))
			CBResult.Items.Add(("39 Unknown"))
			CBResult.Items.Add(("40 Unknown"))
			CBResult.Items.Add(("41 Unknown"))
			CBResult.Items.Add(("42 Unknown"))
			CBResult.Items.Add(("43 Unknown"))
			CBResult.Items.Add(("44 Unknown"))
			CBResult.Items.Add(("45 Unknown"))
			CBResult.Items.Add(("46 Unknown"))
			CBResult.Items.Add(("47 Unknown"))
			CBResult.Items.Add(("48 Unknown"))
			CBResult.Items.Add(("49 Unknown"))
			CBResult.Items.Add(("50 Unknown"))
			CBResult.Items.Add(("51 Unknown"))
			CBResult.Items.Add(("52 Unknown"))
			CBResult.Items.Add(("53 Unknown"))
			CBResult.Items.Add(("54 Unknown"))
			CBResult.Items.Add(("55 Unknown"))
			CBResult.Items.Add(("56 Unknown"))
			CBResult.Items.Add(("57 Unknown"))
			CBResult.Items.Add(("58 Unknown"))
			CBResult.Items.Add(("59 Unknown"))
			CBResult.Items.Add(("60 Unknown"))
			CBResult.Items.Add(("61 Unknown"))
			CBResult.Items.Add(("62 Unknown"))
			CBResult.Items.Add(("63 Unknown"))
			
		End If
		CBResult.SelectedIndex = old
	End Sub
	
	'UPGRADE_WARNING: Event CBDifficulty.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	'UPGRADE_WARNING: ComboBox event CBDifficulty.Change was upgraded to CBDifficulty.TextChanged which has a new behavior. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="DFCDE711-9694-47D7-9C50-45A99CD8E91E"'
	Private Sub CBDifficulty_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles CBDifficulty.TextChanged
		'Difficulty.Text = Str(CBDifficulty.ListIndex)
	End Sub
	
	'UPGRADE_WARNING: Event CBDifficulty.SelectedIndexChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub CBDifficulty_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles CBDifficulty.SelectedIndexChanged
		
		Difficulty.Text = Str(CBDifficulty.SelectedIndex)
	End Sub
	
	'UPGRADE_WARNING: Event CBResult.SelectedIndexChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub CBResult_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles CBResult.SelectedIndexChanged
		
		Result.Text = Str(CBResult.SelectedIndex)
	End Sub
	
	'UPGRADE_WARNING: Event CBSkill.SelectedIndexChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub CBSkill_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles CBSkill.SelectedIndexChanged
		
		Skill.Text = Str(CBSkill.SelectedIndex)
	End Sub
	
	'UPGRADE_WARNING: Event CBType.SelectedIndexChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub CBType_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles CBType.SelectedIndexChanged
		
		SpellType.Text = Str(CBType.SelectedIndex)
	End Sub
	
	'UPGRADE_WARNING: Event Rune1.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Rune1_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Rune1.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		Spells(selectedSpell).Rune1 = App.EFChange8(Rune1, 0, 255)
		modifiedspell(selectedSpell)
		subchange = False
	End Sub
	'UPGRADE_WARNING: Event Rune2.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Rune2_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Rune2.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		Spells(selectedSpell).Rune2 = App.EFChange8(Rune2, 0, 255)
		modifiedspell(selectedSpell)
		subchange = False
	End Sub
	'UPGRADE_WARNING: Event Rune3.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Rune3_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Rune3.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		Spells(selectedSpell).Rune3 = App.EFChange8(Rune3, 0, 255)
		modifiedspell(selectedSpell)
		subchange = False
	End Sub
	'UPGRADE_WARNING: Event Rune4.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Rune4_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Rune4.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		Spells(selectedSpell).Rune4 = App.EFChange8(Rune4, 0, 255)
		modifiedspell(selectedSpell)
		subchange = False
	End Sub
	
	'UPGRADE_WARNING: Event Fatigue.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Fatigue_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Fatigue.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		Spells(selectedSpell).setfatigue(App.EFChange8(Fatigue, 0, 63))
		subchange = False
	End Sub
	'UPGRADE_WARNING: Event Difficulty.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Difficulty_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Difficulty.TextChanged
		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.SelectedIndex = 15
		Else
			CBDifficulty.SelectedIndex = Spells(selectedSpell).Difficulty
		End If
		subchange = False
	End Sub
	'UPGRADE_WARNING: Event Skill.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Skill_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Skill.TextChanged
		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.SelectedIndex = Spells(selectedSpell).Skill
		Else
			CBSkill.SelectedIndex = 15
		End If
		subchange = False
	End Sub
	'UPGRADE_WARNING: Event SpellType.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub SpellType_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles SpellType.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		Spells(selectedSpell).setspelltype(App.EFChange8(SpellType, 0, 15))
		CBType.SelectedIndex = Spells(selectedSpell).SpellType
		selectspelltype((Spells(selectedSpell).SpellType))
		subchange = False
	End Sub
	'UPGRADE_WARNING: Event Result.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub Result_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Result.TextChanged
		If subchange = True Then
			Exit Sub
		End If
		subchange = True
		Spells(selectedSpell).setresult(App.EFChange8(Result, 0, 63))
		CBResult.SelectedIndex = Spells(selectedSpell).Result
		subchange = False
	End Sub
    Private Sub Cancel_ClickEvent(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Cancel.Click
        Hide()

    End Sub
	
	
    Private Sub SpellList_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles SpellList.SelectedIndexChanged
        If SpellList.FocusedItem Is Nothing Then Exit Sub
        selectSpell(SpellList.FocusedItem.Index + 1)
    End Sub
	
	
    Private Sub Ok_ClickEvent(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Ok.Click
        Dim i As Integer
        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

    Private Sub SpellEditor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        SpellList.SmallImageList = App.JewelIL
    End Sub
End Class