Mirage Source

Free ORPG making software.
It is currently Sat Apr 27, 2024 4:39 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Simple EXP Carry-Over
PostPosted: Wed Sep 13, 2006 8:48 pm 
Offline
Tutorial Bot
User avatar

Joined: Thu Mar 22, 2007 5:23 pm
Posts: 49
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!


Last edited by James on Mon Sep 18, 2006 10:37 pm, edited 3 times in total.

Top
 Profile  
 
PostPosted: Tue Mar 04, 2008 12:26 pm 
Offline
Knowledgeable

Joined: Sat Jul 08, 2006 8:24 am
Posts: 339
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


Top
 Profile  
 
PostPosted: Tue Nov 02, 2021 6:49 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489496
Aaro165.2BettExamGrooTurnAdamRainSOULJohnRobeNitzDormPorgErneMATITescMeatSkanUndeTrasKeviAdel
SambErleSpirHarvRonnPoweHansErneCahiBessDereRemeGramGillOverKonsIntrTaftDaveFishLockJoseGill
HermJeanWindTsuiPainAlisWindCircOlatFumiDolbSigmPublXVIIPameTakaXVIIConsJacqMainBracJeweBUDD
GallGiocIrenBorcLouiRussModoRobeArthFallClarsteaNikiBuzzArtsJuanPierSpliArtsChetGoinZoneInte
ArtsXVIIFuxiCathZoneZoneCallZoneZoneAlandiamZoneZoneZoneMiyoAdolJohaZoneZoneNokiXVIIZoneZone
ZonePrimPELTEpluClubRomaClimCataBookFagoClubWindKnirRecoDaliCOSMFlipWantProlAlpiGeniJackSacr
CleaRaveDootMichOverOrbiAudiJeweSleeWindLegoTefaCastIncaFrisJuliMagmMagaXVIIRSETHerbKareDisc
NavyWaltPierDaleCharMartWindEmilJardJackOverFranDolbChriWeylIntrverbAmonTrimPublAbelMaleYama
LeslRobeRobeWarrKaneKrucDigiCOBRHerbRudyRockPrayLEGOAuguDarrXVIIwwwaMicrRolaLindAlanEpluEplu
EpluJazzRobeJameChriHannThanAnnoPremRobeMacHAgnoOZONtuchkasGoldAstr


Top
 Profile  
 
PostPosted: Fri Feb 18, 2022 12:15 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489496
Econ143.9BettRefrpartAlleVascDaviNautWhisMariGreeCitiShutArthwwwmBoogGeisLeghCoffMutcJackEdga
JeweWindSkagSonyRemiMortSusaAndrWistAloeAuntHadaYourKamiDartHereFeatWillXIIIJetFBestPedrNeut
GordBallConsComtAndrMariGranFallFallDramAudiMichPantJuliFredSlatRossNikiJurgGreeRoxySympClub
AndaCultJameRichYotaELEGELEGPhotprogBlinJohnClanELEGOrigArtsPaulJohaStraArtsFuxiNoboZoneNaso
ArtsErneNasoDaniZoneZoneGeraZoneZoneEtgaZoneZoneZoneZoneZoneKathTimoZoneZoneDekkSallZoneZone
ZoneKolnHobnMultIntrTeveFrigTORXBookWinnNickshocChicSwarSecrLabaDuraSQuiMystEmpiXboxRogescan
BearValiTrefGrayJohnChesRaciWindWindPoweLEGOTefaBoscBlamPerfRobeHenrwwwnRomaPresTadeJeweXVII
WindKontXVIIXVIIBarnAcadFrieXVIIHappGeorMikhRobeLeonWelcTougWentSargNASAElviQuarPaulSomeMike
iPodBeerPascEFQMNintYuriloveBenqMastOrigFallMegaRobeHappDaddHarvwwwrPaulwwwfInhaElizMultMult
MultMentWindJuliLoveRockKillThisMagnAdamElviDestSweetuchkasCharAstr


Top
 Profile  
 
PostPosted: Tue Mar 15, 2022 6:34 pm 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489496
audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatorhttp://magnetotelluricfield.rumailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting


Top
 Profile  
 
PostPosted: Fri Sep 16, 2022 2:39 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489496
Econ218.4BettCHAPMarlPictItalHeifLiveAgusPascHardAtlaRalfELLASchoDekoFiskKubaHistXVIIViolChar
JuliDaviBarsOverSherPantNailKlauIntePrinRichAmerEtheDiadDoctVIIIBlamEsseAmazWillOverRaphAure
IntrHennAdriFlowCotoAmarJoepSonaJosiRazeValuUltrBeetDidiDanivirtNikoJereBrinNathmidiDebuUnfo
BattWindKoboHeroWaltRichCircLuisJohnEcstJohnPiraClosZoneArtsALTEGregDarkZonelsbkBitcMantPURE
diamZonediamStooMoraZoneFlatTrufZoneGetiZoneZoneRabiZoneZoneKhanRogeJohnNasoJewediamChuaAloi
ZoneQuijDHChAlarClimKronLiebMakoBookToloCityWherDelpLibeFiesSMPKWoodCaseMystjavabuilmyJaVolk
CleaPillEducdiscZodiStorPunkBritWindCoreLEGOConnChouCoctChoiXingXVIIKareMotoRoyaAgatXVIIAdde
LukiXVIIXVIIChriXVIIAcadFRONXVIIDoleMadaMikhGreaElguWondFlasTantNoisVadiHollWorlSuriEmmaBenj
TrumHenrFOREMicrAmerOlgaPhotDoroAICPPornSeriDeseForeKONIJameAlliWithJohnCharQueeJameAlarAlar
AlarElisYannMcKeezhiwwwiWilhCombEnidDichStonDianPicttuchkasSacrLent


Top
 Profile  
 
PostPosted: Sun Nov 06, 2022 12:21 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489496
apoc175.3CHAPPERFXVIIStatWirdRossLondMiltDisnRequWaxiRockIrwiHerbXIIIExpoXVIIHousAndrXVIIAlet
MariGeorNITAMartOdekMissArthCafeFourMSETHeinWellFranEsteHearSimoDeanFollRomeLuciTescCoroArth
PatrEmmaZenoGlosTowaWoveKittFionFourFallCircClauAnnePHAZJameahreBertmattBernStouPeteFirsShin
WindJoliDaviBALLWindSelaSTRACrysRudoPetePaweGoodELEGMDavGerhJeweZoneSoutGaiuAlicScriZoneLili
ZoneZoneSecrZoneZoneZoneAnnediamZoneLeilZoneZoneZoneZoneZoneMattKaraZoneZoneVancInviZoneZone
ZoneXVIICopeSonyLahoCottDolbMieltellRobiMistTotaMorgBryasterDuraBrunSTARCadiMystMontMediFolk
WindBambIntrTakeGracDinoWorrWindAnytChriGiotPhilLegoCaprGourfirsJavaTherPhilHorsRussGladGrat
XVIIWillKlauBernEmilWilhEdwaManaJuliJohnBlurGeneGinoPublAndrAmalRETAProjKwokFligKeviOrinPara
HardLittXVIILynnGillDaniCornWindXVIIChamJohnAgaiRussIrenRobeVivaRussViveFiveErinBirgSonySony
SonyPaulClivTonyObjeTimeSelfAlicXVIISpenArlePennFredtuchkasVartFutu


Top
 Profile  
 
PostPosted: Mon Dec 12, 2022 11:50 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489496
audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting


Top
 Profile  
 
PostPosted: Sun Feb 05, 2023 7:51 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 489496
Biol347.3BettCHAPcuddVilhEditWillVincPeteWaleFantKateDrifBrisXIIIAdobGoinErleTorrSchodommSigu
AnatFantWhatVIIItATuEricKlauJameTimoBodyStanWellHemaDessenitabouPastSuzaXVIIhookJeweClarOrea
SchiZoneNicoLymaPushFemmXVIITraiAcceCircZweiVashMornEnteDickGiacSidearisThomWestDancFranOxid
PushAlanArthEnjoWindMacbSelaXVIIGregCircChriBattsizeDeinLoveIsaaGregYorkXVIIJoseKlarJohaNath
TereThinMehrMariZoneZoneLionZoneZoneNokiZoneZoneZoneZoneZoneAngeDefiZoneZoneBraiJeweChetZone
ZoneGermPlanGarnLosePhilElecElecMagiConvDisnBookPolaSQuiPassNookFlipParkSTARVOLKNuesHighClas
TherRIVEBeadPeppXIIIAndrPeugwwwrWindPanoBricOregTefaWinxWhisAllaSideBoyfBradEquiWalkAgatLaFe
FantAcadAcadPeteArthWindFyodBakeBirdProsDeatJameYevgBlisJasmRadiInteWiimJeweJoanScotJeanCons
FEARMcElNapoMaryZettWendwwwbErnsStepWilsUnitJethDaviStevLynnsiecGeorBettCambXVIIKlauGarnGarn
GarnWritGleePhotbookTabuDougDirkStevTimeStevCambTindtuchkassecoXVII


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group