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

Spell Buff
http://web.miragesource.net/forums/viewtopic.php?f=210&t=4756
Page 1 of 2

Author:  Xlithan [ Wed Nov 19, 2008 2:18 am ]
Post subject:  Spell Buff

I want a new spell type that increases a stat temporarily for say, 60 seconds.

Not interested in suggestions, just need a tutorial (As this is the tutorial request section).

Thanks :D

Author:  Anthony [ Wed Nov 19, 2008 3:11 am ]
Post subject:  Re: Spell Buff

I would actually be interested in hearing suggestions.

Author:  Matt [ Wed Nov 19, 2008 7:45 am ]
Post subject:  Re: Spell Buff

This is easy to do.

Add a variable to the spells to hold the length. Then in the cast spell stuff, check for that spell type, target, and then get the time if it's proper. Then in the gameloop, just check that, if the time is still not run out, then the player's stats are enhanced.

Simple.

Author:  Labmonkey [ Wed Nov 19, 2008 6:40 pm ]
Post subject:  Re: Spell Buff

Then what happens if the player logs out perfekt?


on playerlogout or whatever, check to see if the person has a buff (by thier timer). If yes, run the debuff code.

Author:  Matt [ Wed Nov 19, 2008 6:48 pm ]
Post subject:  Re: Spell Buff

Labmonkey wrote:
Then what happens if the player logs out perfekt?


on playerlogout or whatever, check to see if the person has a buff (by thier timer). If yes, run the debuff code.


I wasn't gonna give all the stuff. :P

Author:  Forte [ Thu Nov 20, 2008 12:20 am ]
Post subject:  Re: Spell Buff

I've actually just recently added buffs to my project. I'm afraid I won't give out my code but if you need any help feel free to contact me.

Author:  William [ Fri Nov 21, 2008 12:35 pm ]
Post subject:  Re: Spell Buff

Im using a couple of variables for this:

Client Side:
BoostHPTimer - Displaying how long time its left on the buff.
BoostHP - Displays how much boost you gained

Server Side:
BoostHPTimer - Checking when to end the buff (tickcount)
BoostHP - Used to add the extra MAX HP in this case

Both Sides:
BoostHPDur - How long the spell will last

I started a tut for this but I didn't finish it.. its posted in the admin board.. =/

Author:  Xlithan [ Sat Nov 22, 2008 7:04 pm ]
Post subject:  Re: Spell Buff

I thought Mirage Source was about sharing codes?

Come on guys, what's the point in having all these help forums if nobody is willing to help?
It's fine saying "Yeah this is how it works", I know how it works, but where to put the code is a different matter.
Me and Drackir already tried to get it working but couldn't, plan B? Ask somebody else.

First of all, the server needs to know what spell was just activated, and who it belongs too. It performs the neccessary action. It also needs to check if the spell has already been activated, and not to activate it again.

I thought it would be easy but it's not.

Author:  Xlithan [ Tue Nov 25, 2008 5:19 pm ]
Post subject:  Re: Spell Buff

William wrote:
I started a tut for this but I didn't finish it.. its posted in the admin board.. =/


Can you PM me the tut?

Author:  William [ Tue Nov 25, 2008 6:15 pm ]
Post subject:  Re: Spell Buff

It's far from finished. I just realized making the tut would be so much work and I wasn't really up for it. Because I didn't want to make it full copy and paste. Might get around to finishing it at some time.

Author:  Matt [ Wed Nov 26, 2008 3:47 am ]
Post subject:  Re: Spell Buff

GameBoy wrote:
I thought Mirage Source was about sharing codes?

Come on guys, what's the point in having all these help forums if nobody is willing to help?
It's fine saying "Yeah this is how it works", I know how it works, but where to put the code is a different matter.
Me and Drackir already tried to get it working but couldn't, plan B? Ask somebody else.

First of all, the server needs to know what spell was just activated, and who it belongs too. It performs the neccessary action. It also needs to check if the spell has already been activated, and not to activate it again.

I thought it would be easy but it's not.


Beggar's can not be choosers. Quit whining. Remember when you claimed to be a great programmer? Now even people who don't program anymore are better than you.

Learn to do it yourself. Quit begging, after you already begged initially. I gave you the base of how to do it and someone followed through with some more of it. Figure it out from there. If you don't know where to put it in MS yet, then you should just go kill yourself. You've worked with MS for years, I'm sure you know your way around. If not, might I suggest you just use your computer for playing solitaire and surfing the internet for porn?

Author:  William [ Wed Nov 26, 2008 7:24 pm ]
Post subject:  Re: Spell Buff

Perfekt that might be your opinion. But this board is here for a reason. I would gladly make small tutorials, but this buff thing just takes too much time for me to complete. This was my start, but far and far from finished:

I was going to write a tutorial for adding buff spells. But not making it copy/paste.. and I realized after a few steps that this will take for ever to complete. xD So im not going to do this.. =/

Introduction
I decided to make a tutorial for adding buff spells. This is not going to be anything like a copy/paste tutorial. I will share some code parts and try to explain some areas, but I also want you to figure out a few things on your own. I will not divide the tutorial into a client and a server part, instead I will explain some parts on the client, and how they are linked to the server and visa versa. Also, it's important that you keep something in mind. I'm taking parts from my game now, and my game doesn't have spell types, this means that my spells can have any effects. Like all spell types could be in 1 spell for example.

Step 1, Deciding the Basics:
First of all, I recommend you add a new spell type for the buff spells. For example name it SPELL_TYPE_BUFF. To understand how this is done, you can search for SPELL_TYPE_ADDHP in the client and the server to get some understanding how it looks. You should also keep in mind what kind of buffs you want. I added the ability to boost any of the stats the player has.

Step 2, Setting up the Form:
Now you need to add some text boxes to your frmSpellEditor, kind of like this:
Image
But you need to remember that you also need to do more changes to the form. To the list box that stores the SPELL_TYPES, and also if you want to make the buff window be visible=false if your not creating a buff spell and such. But before you can save them and send them to the server. You need to add the variables for the buffs.

Step 3, Setting up the Variables:
There are many ways of doing this, but the very easiest way is to do the following; The player needs to hold the buff spell num in order to be able to see the spell in action on the client. If the player don't have the buff spell num thats casted on him, he wont be able to see his stats changed and such. Or perhaps you want a nice image for the buff on the game screen when its active. So you should add something similar to this in the playerrec:
Code:
    BoostHPSpellNum As Byte
    BoostMPSpellNum As Byte
    BoostSPSpellNum As Byte
    etc..

Author:  Matt [ Thu Nov 27, 2008 5:08 pm ]
Post subject:  Re: Spell Buff

Steve used to brag about how great he was, now he asks for super simple features.

More than the noobs, I might add.

Author:  William [ Thu Nov 27, 2008 6:50 pm ]
Post subject:  Re: Spell Buff

Perfekt wrote:
Steve used to brag about how great he was, now he asks for super simple features.

More than the noobs, I might add.

Buff spell isn't a super easy feature. For some it is, but for most it's not.

Author:  Matt [ Fri Nov 28, 2008 1:22 am ]
Post subject:  Re: Spell Buff

William wrote:
Perfekt wrote:
Steve used to brag about how great he was, now he asks for super simple features.

More than the noobs, I might add.

Buff spell isn't a super easy feature. For some it is, but for most it's not.


Agreed.

You're taking my posts out of context though. Gameboy brags constantly how great he is. Or, well he used to. I'm saying, for someone as great as he claims he is.. He shouldn't have any issues doing this.

Author:  Lea [ Fri Nov 28, 2008 3:37 am ]
Post subject:  Re: Spell Buff

I had a buff system written for LoM.

Could buff anything in the game, and all buffs were implemented. The game had no way to give you a buff, though, but when you got one it worked lol

Author:  William [ Fri Nov 28, 2008 8:24 am ]
Post subject:  Re: Spell Buff

Lea wrote:
I had a buff system written for LoM.

Could buff anything in the game, and all buffs were implemented. The game had no way to give you a buff, though, but when you got one it worked lol

lol =/

Author:  Matt [ Fri Nov 28, 2008 4:55 pm ]
Post subject:  Re: Spell Buff

Lea wrote:
I had a buff system written for LoM.

Could buff anything in the game, and all buffs were implemented. The game had no way to give you a buff, though, but when you got one it worked lol


Um..?

Author:  Lea [ Fri Nov 28, 2008 7:26 pm ]
Post subject:  Re: Spell Buff

I thought it was relevant. Guess not, since I wasn't asked for the code :D

Author:  William [ Sat Nov 29, 2008 12:30 pm ]
Post subject:  Re: Spell Buff

Lea wrote:
I thought it was relevant. Guess not, since I wasn't asked for the code :D

It was funny what you wrote :D You said the buff worked fine you buffed something but you didnt have a system for casting or something like that :P

Author:  Lea [ Sun Nov 30, 2008 5:29 am ]
Post subject:  Re: Spell Buff

I had/have yet to implement the job system and the buff spells, but the buffs themselves worked...

just no way to get one :P

Author:  Xlithan [ Sat Dec 20, 2008 2:11 am ]
Post subject:  Re: Spell Buff

William, thanks for the tips. I never thought of doing it that way at first, just adding a seperate spell type for each of the TYPES of buffs, like raising armor or individual stats. You would also need a timer, since buff spells need to wear off.

Matt, stfu. :roll:

Author:  Matt [ Sat Dec 20, 2008 3:47 pm ]
Post subject:  Re: Spell Buff

No Steven.

Author:  wanai [ Tue Nov 02, 2021 6:23 am ]
Post subject:  Re: Spell Buff

Econ135.8BettNoteRougAlanJeweAlfrOnceJerzStanWondMartRounJackMORTCandCONSAlsaTideJoanDeanXVII
RockRomaWoodMomeStorStanHitsChucJohnExclJeweFiskChooFailVasiJeweTabuWillClauValiRemiJackPlan
GreeZoneLewiAdamSusaPushStreDigiExceBlurWindXVIIRoryXVIIHervFranPablSelaSadoMarcJewePartBest
VoguXVIIVIIIFlemXVIIPaliELEGMatLBonuFallJaynGeniNikiFighArtsMargJeffBullFuxiEdmoRidediamFuxi
MoreVeraInviAlanZoneZoneErleZoneZoneSwinZoneZoneZoneZoneMORGIDEFAndrZoneZoneSamsAnneZoneZone
ZoneStarKafimultVIETDenvFraundasTracMatcVictWitcTexaRoseLeifLabaProfViolBlauwwwnBaltBettFolk
ValiValiTrefVaniParkSudoAuthWindWindPoweLEGOTefaDremKnocKiteMarkAnimLifeAvMaMoscFutuJeweBill
WindAcadAssoXVIIJeffHonoXVIIXVIIXVIIThinLouiCommPeerLeonAlbuRecoThisReveThisChriNexGMichLind
ImagSWOPApplLyndThirXIIIMoneSonyNostPopSGramRichWindJeffMicrfounCharJerrMPEGGeraViolmultmult
multAvasBlytJoseGoinWilhClasThisSardSideJohaCambGladtuchkasStudAnna

Author:  wanai [ Thu Feb 17, 2022 11:49 pm ]
Post subject:  Re: Spell Buff

Kbps92BettBasiQueeHenrGhosNighBonuGuidGeraBangMichKronJuleAmatRomaJudiTescBrenBechRobeTesc
AttiChriItalSussYuriSileRobeXVIIPublOLAYGregZindJewePureMircJohnSTARXVIILouiKotaArmaRalpOlle
DoveZoneacidMichVoguamouOnliTeneAdiogunmCarlTinaWritJudiGaumFredBonuCalvFranAlexSympLondCall
CannHomoLudwStriRobeWorlELEGCallPlunCircDaphHeavNikiLebeArtsXVIIStefFantFuxiDianMancZoneArts
ShabAdriArtsMozaZoneZoneXVIIZoneZoneJameZoneZoneERINZoneZoneOlivDisnZoneZoneStevAndrZoneZone
ZoneSaviXVIIPionXVIIBelvClimNVMTBookFantBookEspeEcleTimePostGiglAntiHappMystUmbrReguManuruss
EconRickFaunCathChicWinxMajoWindLoveWindWorlBrauChouDaliPlanilbuEverSeekFranPrelRadiOrgaJose
JeweBranFranXVIIDaviXVIIFrieKadiNotiOZONCitiGaliCanaMissOrdeRetrSergNaruBeauKeviWolfAlonGerh
LogiCocaMichDaniMontLindCaroKathTomiFyodAmplEatsEleaXVIIAstrButcJeweDaniSomeArleBurnPionPion
PionMoirFranWizaKetaMarkFredJoneWillCampLymaThunConntuchkasLefeWilh

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