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

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 Big Grin or is it messed up to an evil extent :twisted: ?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)