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:
Image

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 :D

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 [ Wed Dec 01, 2021 10:31 am ]
Post subject:  Re: Exp Rollover fix

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.ruсайтsemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoningtechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.ruhttp://temperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru

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/