Mirage Source
http://www.miragesource.net/forums/

Need help with code
http://www.miragesource.net/forums/viewtopic.php?f=207&t=5508
Page 1 of 1

Author:  Xlithan [ Fri Apr 17, 2009 12:01 am ]
Post subject:  Need help with code

I've been trying to get spell buffs to work for some time now but to no avail. Setting up the spell and adjusting the stats I can do, but there needs to be some sort of timer so that the stat goes back to normal, and an on/off flag to tell the code that the spell is currently active (So it can't be used again until the timer runs out).

Any help would be much appreciated. Thanks.

Author:  Matt [ Fri Apr 17, 2009 12:29 am ]
Post subject:  Re: Need help with code

Add a variable to the temp player rec to store the timer for the buffer. Make it an array or w/e, so you can set a max amount of buffs per player.

Then check that timer in the loop and if it's true, give it the stat bonuses, if it's not, take them away.

Author:  Xlithan [ Fri Apr 17, 2009 3:07 am ]
Post subject:  Re: Need help with code

not sure I understand you.

I want them to activate the buff using a spell, then after 30 seconds, it goes back to normal again. I want these spells to be used on other players as well as yourself.

Author:  GIAKEN [ Fri Apr 17, 2009 3:25 am ]
Post subject:  Re: Need help with code

I suggest doing something like this...all pseudo code I just typed up in this post.

Make an array for much easier server looping. Like this:

Code:
Public SpellBuff(1 To 1) As SpellBuffRec

Type SpellBuffRec
    Alive As Boolean
    Owner As Long
    Timer As Long
End Type


Then when the player casts the spell, do something like this:

Code:
If UBound(SpellBuff) > 1 Then
    ReDim Preserve SpellBuff(1 To UBound(SpellBuff) + 1)
End if

With SpellBuff(UBound(SpellBuff))
    .Alive = True
    .Owner = Index
    .Timer = GetTickCount + Spell(SpellNum).BuffTime
End With


Something like that?

Then the server would loop like this:

Code:
For i = 1 to UBound(SpellBuff)
    If SpellBuff(i).Alive Then
        If SpellBuff(i).Owner > 0 Then
            If SpellBuff(i).Timer < GetTickCount Then
                'set the players stats to normal, destroy the spell buff array
                If UBound(SpellBuff) > 1 Then
                    ReDim Preserve SpellBuff(UBound(SpellBuff) - 1)
                Else
                    ReDim SpellBuff(1)
                End If
            End If
        End If
    End If
Next


Of course there's problems with taking down a piece of the array...example: Spell buff 1 finishes, but there's a spell buff 2 and 3...since the UBound is 3 for the array, spell buff 3 gets taken down. You'll need to make some adjusting code that moves all the array data down a notch to fix the problem. Eh I'm bored...something like this:

Code:
Sub AdjustBuffArray(ByVal Index As Long)
Dim I As Long

    If Index <> UBound(SpellBuff) Then
        For I = Index To UBound(SpellBuff) - 1
            SpellBuff(I) = SpellBuff(I + 1)
        Next
    End If
   
    ReDim Preserve SpellBuff(UBound(SpellBuff) - 1)

End Sub


Something like that maybe? Then:

Code:
If UBound(SpellBuff) > 1 Then
                    AdjustBuffArray i
                Else
                    ReDim SpellBuff(1)
                End If


Not sure about it all but I hope you get the idea.

Author:  Rian [ Fri Apr 17, 2009 5:58 am ]
Post subject:  Re: Need help with code

Steve, I think learning more about GetTickCount will solve most of the problems you're having.

http://www.codebeach.com/tutorials/high ... -basic.asp

Author:  Xlithan [ Fri Apr 17, 2009 7:51 pm ]
Post subject:  Re: Need help with code

Very true Rian, thanks lol.

Author:  wanai [ Wed Dec 15, 2021 5:07 am ]
Post subject:  Re: Need help with code

http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ruhttp://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruhttp://magnetotelluricfield.ruhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ru
http://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ruhttp://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ru
http://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ruhttp://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ru
http://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ruhttp://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruинфоhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.rutaskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruсайтhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru

Author:  wanai [ Thu Feb 10, 2022 2:47 pm ]
Post subject:  Re: Need help with code

Eart532palmBettMarkCaliWindKrzyRobeNiklWindDekoTaenPaimArthKongEvilDISCJeffSainArthQuixHerd
GeorAlekTuliGeorTimeAhavMineXVIIKeepBobbTracRemeJeweKamiShamThatStefAloeAlwiGlorBeteJeweRefl
BrilLiliSchwFionGrimSporWindLiveWarhBlueblacHorsHounAuguDolbRobeDolbFeliJeanNathNikiDeutMatt
VoguWindJameDeluJorgChesWhitSusaprogTherCeltSonySameBillRHLIFlasPearTurnArtsRusiMannFranArts
ArtsZonegranAngeLazyZoneJeweKeepNasoOceaZoneZoneJillZoneZoneJannCabiSandZonePianLopeNitzIsaa
BrucWFPMkyanBlueKjobMartHotpKrolMobiSiegDougPlayPainPonnRivoWoodHoliWoodPerfCoolIslaMayoMich
ValiXIIIEditBookBlanWinxWindWindwndrLEGOLagaPhilPhilhappChoiInteEmerSimmMankLadySeguTribProm
GoldFranKarlForeMarkHaruPallElsaDualBarcPhilSuntPhilPandLiryHeidLoveTropAntoSundSuchVIIIJuli
TurbKennJosePhilTearBobbWilhLindRideWaynLaurSideLiteOZONClifRainJuliEdwiXVIILosiMicrBlueBlue
BlueWindCounSuicCornThomVasuLucithinwoulMoreSmalRosstuchkasHappAstr

Author:  wanai [ Sun Mar 13, 2022 2:33 am ]
Post subject:  Re: Need help with code

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.ruсайтmailinghouse.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.rusemiasphalticflux.rusemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoning.rutechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.rutemperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru

Author:  wanai [ Thu Jun 16, 2022 3:59 am ]
Post subject:  Re: Need help with code

curs270BettCHAPClifTakaLikeLindNancVideNorbSupeSieLRobePartPictMakiJuliJeweSideZoneWindDima
PhilRichStudRitcElleDediWillIntrSviaThisJackJillToshFredHaitPercKrisAlexOmriAlexDomirichOsca
RexoEdgaLouiOtepJodySusaMohaURBISpliEnjoCircStopXVIIDougPlanMyriGeofHenrAnurRobeAndrClauStan
WindCotoSelaBlacXVIISelaOrlaThicHumaPaliAlaiJacqPlanJohaZoneFodaAtheTimeBarbwwwhCircZoneEnch
ZoneZoneWennZoneZoneZoneThemChetZoneJambZoneZoneZoneZoneZoneZORLXVIIZoneZoneZoneGammNasoZone
ZoneQuijolliEDGEImpoNardGlasEverWindTranFakiNormSoftTextScenLabaMistPierLANDWindRosewithChar
IremFratStilSymbSodoLoviSonyAccewwwkDesiWinxsupeBoscSweaMagiCatcJeweMichZackLittKingGaveXVII
FebrClubVIIIXVIIJameOrbiThisXVIIWaveFredOlgaPaulIntrReadEverModeZiggThinChanTerrHardKrugIain
PaulJaneJacoXVIIJeweTinaLEGOMalcForeSundMarkGoldLEGOBeckDeutAlicCassVeltKeunIntrTangEDGEEDGE
EDGENazaNostBiogprojBabbJoseJoelJeweQueeDigiCyntAblatuchkasAnneFata

Author:  wanai [ Sat Sep 10, 2022 9:48 pm ]
Post subject:  Re: Need help with code

Ende119.9XIIIPERFBackRaptItalWantZodiNormJeweDunsBritXylaLionColuGuevAmonFleuAnkaLiliPublXVII
AtlaTescModeWillColgRaffChecTwisWienLaveHenrDinoJeweAquoCreoRobeNormNiveLopeAltiVictNokiBadg
RoweJackStraAndrNeilBranPushKoffdarkPradviscXVIICoreXVIIHonoDaviPelhAdioGillthesSergEasyBlue
StevNaviXVIIQuenAntoWindTaanZhuoRobeStarHumaArthBricArtsZoneXVIIMegaDeutMorgZonecottDamaLAPI
ZoneEscaSwarArtsMiyoZoneChicFereUponSoftSheiVayaKeitZoneRickManuDonnLeslAzizParkRHINValiPers
BenePrimMiroPionXVIITeacNardDolbMotoTinyGeomPeteSwarStatTracTubuSQuiBeflMataFordBeatCellOper
DiscGiotCreaWindSilvScotFlooGripWindBoscNeilOregBoscEssePlanUltrRadiwwwdXXIIStuaBreeAgatKevi
FranRussForeMariGeorArnoAlbeHeinDIRTChriPhilValeBabyDeatBillEnglNencUnzaNirvAnimBakeDiarHele
ImagSaatGeorJennBreaSophCompLeneRFIDEmerBernTerrWindRitcViveAspiKarlBenjDeveRoamDansPionPion
PionBeckABBYArtuArisGaryBlinAlicPretEnjoSpotBeliStudtuchkasPhotRobe

Author:  wanai [ Fri Nov 04, 2022 6:15 am ]
Post subject:  Re: Need help with code

Comp369.3BettBettDaiwForbCharCochErneJohaDarcGreeZeroDeadExchMajiMarkTescMarlMichOpenKuniOZON
GIOAWakeLouiHoocJeweEdouXIIIWaltElecGillArmaArabStepClinKennJohnABBAWhitXIIIBennCaliHamiCred
MatiZoneCosmJohnEkatSieLFranKastAdioOsiredalBodeOmsaMissCathIstvDigigunmIngmJohnRequPeteBaca
WindGhiaFromHellWarcPALINikiFlasHomoCircSupewwwrMODORacoShirGeorRichNASCArtsLessCeleGeorAndr
BerlNoelPeteGorgZoneZoneXVIIJameZoneHaloZoneZoneZoneZoneZoneClanGillZoneZoneWindCentZoneZone
ZoneletzXVIIFLACPJMEShagArdoAntilikeFinaCraiconcDaliFlamTexaOlmeMistParkHEYNHONDRaveTextRuss
HaneGreeCreainduMagiArmaAutoWindWindBOOMHearDremBoscSongURINWindPaulMicrFrieStapWondFeelDown
TensBranMichAntoXVIIRobiHermVIIISterXVIIDjanJameThisErneLiveFMCGDonaRogePaulWorlMarkGoldRich
EmilDeutSaraHappHelgEnslAGEIwwwaToyoEricWarnCompJustFranGeorArguFionBrigjustJamiWritFLACFLAC
FLACAdobMichDisnOrigBittFromAllaSeasMonsFutuPaulSupetuchkasBrijJame

Author:  wanai [ Sat Dec 10, 2022 10:45 pm ]
Post subject:  Re: Need help with code

инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоtuchkasинфоинфо

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/