31-12-2006, 02:45 AM
Hello, I have been browsing the forums the past few days, looking for interesting things. I found Magnus's tutorial on carrying over EXP after a player levels up. It is my first time coding in Mirage, so here goes (I re-made my levelup sub)
Is this good
or is it messed up to an evil extent :twisted: ?
Code:
Sub CheckPlayerLevelUp(ByVal Index As Long)
'**S*O*U*R*C*E***E*D*I*T****************************************************************
'* Deathlycat - *
'* Revamped entire levelup system to have EXP carry over after a player levels up *
'* 12/30/06 *
'***************************************************************************************
Do While GetPlayerExp(Index) >= GetPlayerNextLevel(Index)
' When a player has more EXP than the TNL states, give them the EXP that they have left after they level up
Call SetPlayerExp(Index, (GetPlayerExp(Index)) - (GetPlayerNextLevel(Index)))
Call SetPlayerLevel(Index, GetPlayerLevel(Index) + 1)
' Gives the player stat points based on their current level divided by 10
Call SetPlayerPOINTS(Index, (GetPlayerPOINTS(Index)) + (GetPlayerLevel(Index) / 10) + 1)
' Tells everyone that that player leveled up
Call GlobalMsg(GetPlayerName(Index) & " has gained a level!", Brown)
Call PlayerMsg(Index, "You have gained a level! You now have " & GetPlayerPOINTS(Index) & " stat points to distribute.", BrightBlue)
Loop
End Sub
Is this good
