Mirage Engine
Spell Levels - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: Spell Levels (/showthread.php?tid=893)



Spell Levels - Rezeyu - 22-04-2007

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:

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.


- Da Undead - 22-04-2007

I think this is right, good find Big Grin