22-04-2007, 05:32 AM
Well, I was writing a small packet edit to the spells packets so that I could display some info in the client's lstSpell, and for 2 hours (Took a pizza break too) I couldn't get it to work, I tried a number of things, then I figured I should check at how Mirage loaded the LevelReq for spells, and then I noticed this:
So yeah, It doesn't load said spells. then I scrolled up, and realized it doesn't save them either.
So, I added this to Sub LoadSpells():
And this to Sub SaveSpell(ByVal SpellNum As Long):
And that -should- fix it.. I think.
Unless I'm just retarded.
Code:
Sub LoadSpells()
Dim FileName As String
Dim i As Long
Call CheckSpells
FileName = App.Path & "\data\spells.ini"
For i = 1 To MAX_SPELLS
Spell(i).Name = GetVar(FileName, "SPELL" & i, "Name")
Spell(i).ClassReq = Val(GetVar(FileName, "SPELL" & i, "ClassReq"))
Spell(i).Type = Val(GetVar(FileName, "SPELL" & i, "Type"))
Spell(i).Data1 = Val(GetVar(FileName, "SPELL" & i, "Data1"))
Spell(i).Data2 = Val(GetVar(FileName, "SPELL" & i, "Data2"))
Spell(i).Data3 = Val(GetVar(FileName, "SPELL" & i, "Data3"))
DoEvents
Next i
End Sub
So yeah, It doesn't load said spells. then I scrolled up, and realized it doesn't save them either.
So, I added this to Sub LoadSpells():
Code:
Spell(i).LevelReq = Val(GetVar(FileName, "SPELL" & i, "LevelReq"))
And this to Sub SaveSpell(ByVal SpellNum As Long):
Code:
Call PutVar(FileName, "SPELL" & SpellNum, "LevelReq", Trim(Spell(SpellNum).LevelReq))
And that -should- fix it.. I think.
Unless I'm just retarded.