Mirage Source
another question >> - Printable Version

+- Mirage Source (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: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: another question >> (/showthread.php?tid=714)



another question >> - zocheyado - 05-02-2007

how do i edit my classes ? i searched the source coulndt find it , whent into data folder and went to classes but dosnt matter what i change it never works any ideas?


- ShadowLife - 05-02-2007

if you modify the classes.ini file WHILE the server is running, it doesnt reconize the change. Modify the file, then start the server. changes should be visible then.


- zocheyado - 05-02-2007

thanks that worked perfectly Smile also thou , with my new stats the players have higher TNL ware can i change the TNL incresse or watever? or should i just lower my guys stats, i dindt know tnl was determind by stats


- Ambientiger - 06-02-2007

As you say, tnl is controlled by this code in ms.

Code:
Function GetPlayerNextLevel(ByVal Index As Long) As Long
    GetPlayerNextLevel = (GetPlayerLevel(Index) + 1) * (GetPlayerSTR(Index) + GetPlayerDEF(Index) + GetPlayerMAGI(Index) + GetPlayerSPEED(Index) + GetPlayerPOINTS(Index)) * 25
End Function

In a lot of other sources I've seen the levels are set by the use of an experience/level .ini file using this code instead.

Code:
Function GetPlayerNextLevel(ByVal Index As Long) As Long
    GetPlayerNextLevel = Experience(GetPlayerLevel(Index))
End Function

Where Experience(GetPlayerLevel(Index)) would be the required exp from the .ini file for a player of that level to reach the next.

you can then use it in Sub CheckPlayerLevelUp something like this.

Code:
Sub CheckPlayerLevelUp(ByVal index As Long)
Dim i As Long
Dim d As Long
Dim C As Long
    C = 0
    
    If GetPlayerExp(index) >= GetPlayerNextLevel(index) Then
        If GetPlayerLevel(index) < MAX_LEVEL Then
            Do Until GetPlayerExp(index) < GetPlayerNextLevel(index)
               DoEvents
               If GetPlayerLevel(index) < MAX_LEVEL Then
                  If GetPlayerExp(index) >= GetPlayerNextLevel(index) Then
                     d = GetPlayerExp(index) - GetPlayerNextLevel(index)
                     Call SetPlayerLevel(index, GetPlayerLevel(index) + 1)
                     i = Int(GetPlayerSPEED(index) / 10)
                     If i < 1 Then i = 1
                     If i > 3 Then i = 3
                                
                     Call SetPlayerExp(index, d)
                     C = C + 1
                  End If
               End If
            Loop
            If C > 1 Then
               Call GlobalMsg(GetPlayerName(index) & " has gained " & C & " levels!", 6)
            Else
               Call GlobalMsg(GetPlayerName(index) & " has gained a level!", 6)
            End If
        End If
        
        If GetPlayerLevel(index) = MAX_LEVEL Then
           Call SetPlayerExp(index, Experience(MAX_LEVEL))
        End If
    End If
    
    Call SendHP(index)
    Call SendMP(index)
    Call SendSP(index)
    Call SendStats(index)
End Sub

please note that this isn't a full tutorial on how to do it, you would have to add loading of Experience() into the server and a few other things to get it running, but I hope it gives you some ideas. :lol:

P.S If you want to change your classes without having to shutdown the server, you can use the 'reload classes' option under the 'Database' menu option on the server. :wink: