Mirage Source http://www.miragesource.net/forums/ |
|
Exp Rollover fix http://www.miragesource.net/forums/viewtopic.php?f=184&t=5167 |
Page 1 of 28 |
Author: | Robin [ Tue Mar 03, 2009 7:08 pm ] |
Post subject: | Exp Rollover fix |
Currently, the exp rolls over, but because the CheckPlayerLevelUp is only called once, the exp will basically just pool up, with the level up only ever being called when an NPC is killed. Here's a quick fix. Replace this line: Code: If GetPlayerExp(inde... With: Code: Do While GetPlayerExp(Index) >= GetPlayerNextLevel(Index) Replace the end if at the bottom with: Code: DoEvents Loop All this does, is loop through until the player no longer has enough exp to level up. It'll now spam '[Name] has gained a level!' in the GlobalChat, however. Can quickly fix that by adding this after the loop: Code: Call GlobalMsg(GetPlayerName(Index) & " has gained " & levelCount & " level(s)!", Brown) Call PlayerMsg(Index, "You have gained " & levelCount & " level(s)! You now have " & GetPlayerPOINTS(Index) & " stat points to distribute.", BrightBlue) Adding this to the top of the subroutine: Code: Dim levelCount As Byte Then replacing these 2 lines: Code: Call GlobalMsg(GetPlayer... Call PlayerMsg(Index, "Yo... With: Code: levelCount = levelCount + 1 Then, add this line just above the entire loop: Code: If Not GetPlayerExp(Index) >= GetPlayerNextLevel(Index) Then Exit Sub Here it is in action: |
Author: | Rian [ Tue Mar 03, 2009 11:12 pm ] |
Post subject: | Re: Exp Rollover fix |
Nice. Added <3 |
Author: | GIAKEN [ Tue Mar 03, 2009 11:21 pm ] |
Post subject: | Re: Exp Rollover fix |
levelCount = 0 isn't needed |
Author: | Robin [ Tue Mar 03, 2009 11:51 pm ] |
Post subject: | Re: Exp Rollover fix |
Oops, forgot to add this to tutorial. If you've already added the tutorial, add: Code: If Not GetPlayerExp(Index) >= GetPlayerNextLevel(Index) Then Exit Sub Just before the loop. Added it to the tutorial now, so if you haven't added it yet, don't worry about it. Not having that line in meant the server was spammed with "[Name] gained 0 level(s)!" because it didn't exit the sub if the player hadn't leveled at all ;D That line just exits out if no level takes place. |
Author: | wanai [ Mon Jan 10, 2022 10:13 am ] |
Post subject: | Re: Exp Rollover fix |
Econ |
Author: | wanai [ Mon Jan 10, 2022 10:14 am ] |
Post subject: | Re: Exp Rollover fix |
129 |
Author: | wanai [ Mon Jan 10, 2022 10:15 am ] |
Post subject: | Re: Exp Rollover fix |
Bett |
Author: | wanai [ Mon Jan 10, 2022 10:16 am ] |
Post subject: | Re: Exp Rollover fix |
Bett |
Author: | wanai [ Mon Jan 10, 2022 10:17 am ] |
Post subject: | Re: Exp Rollover fix |
Loui |
Author: | wanai [ Mon Jan 10, 2022 10:18 am ] |
Post subject: | Re: Exp Rollover fix |
Lady |
Author: | wanai [ Mon Jan 10, 2022 10:20 am ] |
Post subject: | Re: Exp Rollover fix |
Edit |
Author: | wanai [ Mon Jan 10, 2022 10:21 am ] |
Post subject: | Re: Exp Rollover fix |
Luis |
Author: | wanai [ Mon Jan 10, 2022 10:22 am ] |
Post subject: | Re: Exp Rollover fix |
XVII |
Author: | wanai [ Mon Jan 10, 2022 10:23 am ] |
Post subject: | Re: Exp Rollover fix |
Jose |
Author: | wanai [ Mon Jan 10, 2022 10:24 am ] |
Post subject: | Re: Exp Rollover fix |
Sony |
Author: | wanai [ Mon Jan 10, 2022 10:25 am ] |
Post subject: | Re: Exp Rollover fix |
Tesc |
Author: | wanai [ Mon Jan 10, 2022 10:26 am ] |
Post subject: | Re: Exp Rollover fix |
Tefa |
Author: | wanai [ Mon Jan 10, 2022 10:27 am ] |
Post subject: | Re: Exp Rollover fix |
Orie |
Author: | wanai [ Mon Jan 10, 2022 10:28 am ] |
Post subject: | Re: Exp Rollover fix |
Jack |
Author: | wanai [ Mon Jan 10, 2022 10:30 am ] |
Post subject: | Re: Exp Rollover fix |
Marc |
Author: | wanai [ Mon Jan 10, 2022 10:31 am ] |
Post subject: | Re: Exp Rollover fix |
Tema |
Author: | wanai [ Mon Jan 10, 2022 10:32 am ] |
Post subject: | Re: Exp Rollover fix |
Skar |
Author: | wanai [ Mon Jan 10, 2022 10:33 am ] |
Post subject: | Re: Exp Rollover fix |
Gott |
Author: | wanai [ Mon Jan 10, 2022 10:34 am ] |
Post subject: | Re: Exp Rollover fix |
Joka |
Page 1 of 28 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |