31-12-2006, 05:30 AM
Code:
'****************************************************************
'* Deathlycat -
'* Revamped entire levelup system to have EXP carry over after a player levels up
'* 12/30/06
'****************************************************************
Sub CheckPlayerLevelUp(ByVal Index As Long)
' If a player has enough EXP to level up, level them up
Do While GetPlayerExp(Index) >= GetPlayerNextLevel(Index)
' When a player has more EXP than the TNL states, give them the EXP that they have left
Call SetPlayerExp(Index, (GetPlayerExp(Index)) - (GetPlayerNextLevel(Index)))
' Levels the player up
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))
' Tells everyone that that player leveled up
Call GlobalMsg(GetPlayerName(Index) & " has gained a level!", Brown)
' Tells the player that they leveled up and how much stat points they have
Call PlayerMsg(Index, "You have gained a level! You now have " & GetPlayerPOINTS(Index) & " stat points to distribute.", BrightBlue)
Loop
End Sub
ther' we go