| Mirage Source http://web.miragesource.net/forums/ |
|
| Simple EXP Carry-Over http://web.miragesource.net/forums/viewtopic.php?f=210&t=511 |
Page 1 of 1 |
| Author: | Tutorial Bot [ Wed Sep 13, 2006 8:48 pm ] |
| Post subject: | Simple EXP Carry-Over |
Author: Magnus Difficulty: 1/5 :: SERVER SIDE :: Find: Code: Sub CheckPlayerLevelUp(ByVal Index As Long) Beneath it, add: Code: Dim ExtraEXP As Long Now, add this before any of the other comment stuff: Code: If GetPlayerExp(Index) > GetPlayerNextLevel(Index) Then ExtraEXP = (GetPlayerExp(Index) - GetPlayerNextLevel(Index)) Else ExtraEXP = 0 End If Change: Code: Call SetPlayerExp(Index, 0) To: Code: Call SetPlayerExp(Index, ExtraEXP) At the end, add: Code: Call CheckPlayerLevelUp(Index) That's all! |
|
| Author: | Joost [ Tue Mar 04, 2008 12:26 pm ] |
| Post subject: | Re: Simple EXP Carry-Over |
Slightly better way to do it. Code: Sub CheckPlayerLevelUp(ByVal Index As Long)
Dim I As Long, ExtraEXP As Long If GetPlayerExp(Index) >= GetPlayerNextLevel(Index) Then ExtraEXP = (GetPlayerExp(Index) - GetPlayerNextLevel(Index)) Call SetPlayerLevel(Index, GetPlayerLevel(Index) + 1) ' Get the ammount of skill points to add I = Int(GetPlayerSPEED(Index) / 10) If I < 1 Then I = 1 If I > 3 Then I = 3 Call SetPlayerPOINTS(Index, GetPlayerPOINTS(Index) + I) Call SetPlayerExp(Index, ExtraEXP) 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) Call CheckPlayerLevelUp(Index) End If End Sub |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|