Difficulty: Medium 3/5
Ok I know this is simple but whatever. What this basically does is instead of using the weird formula that MS provides us with, this will pull whatever you set in the experience.ini and use that... It will basically look like:
[EXPERIENCE] Exp1=1500 Exp2=3000 Exp3=4500 Exp4=6000 Exp5=7500 ...
Ok its all server side.
Here it goes, in modTypes add in:
Public Const ExpMax = 99 Public Experience(1 To ExpMax) As Long Ok this is where it will store all the experience values. If you dont have a max level value set the 99 to 300 or sumthing *whatever you like*
Now in the same module find:
Function GetPlayerNextLevel(ByVal Index As Long) As Long
Replace it with:
Function GetPlayerNextLevel(ByVal Index As Long) As Long GetPlayerNextLevel = Experience(GetPlayerLevel(Index)) End Function This will just find the players level and find what experience value to give.
Now in modDatabase add the following anywhere:
Sub LoadExps() Dim FileName As String Dim i As Long
Call CheckExps FileName = App.Path & "\experience.ini" For i = 1 To ExpMax Experience(i) = GetVar(FileName, "EXPERIENCE", "Exp" & i) DoEvents Next i End Sub
Sub CheckExps() If Not FileExist("experience.ini") Then Dim i As Long For i = 1 To ExpMax Call PutVar(App.Path & "\experience.ini", "EXPERIENCE", "Exp" & i, i * 1500) Next i End If End Sub
Sub ClearExps() Dim i As Long
For i = 1 To ExpMax Experience(i) = 0 Next i End Sub
What all this basically does is Check to see if experience.ini exists, if not create it and set the default value, otherwise load it. The sub ClearExps will just clear the variables.
Now in modGeneral find: Sub InitServer() under Call ClearSpells add:
Call SetStatus("Clearing exp...") Call ClearExps Call SetStatus("Loading exp...") Call LoadExps
These will just call the subs to load the exp.
Hope some people find this usefull ;)
|