Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My first step into Mirage
#4
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)