Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spell Buff
#1
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 Big Grin
Reply
#2
I would actually be interested in hearing suggestions.
Reply
#3
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.
Reply
#4
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.
Reply
#5
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. Tongue
Reply
#6
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.
Reply
#7
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.. =/
Reply
#8
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.
Reply
#9
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?
Reply
#10
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.
Reply
#11
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?
Reply
#12
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: boostqf2.png]
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..
Reply
#13
Steve used to brag about how great he was, now he asks for super simple features.

More than the noobs, I might add.
Reply
#14
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.
Reply
#15
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.
Reply
#16
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 =/
Reply
#17
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..?
Reply
#18
Lea Wrote:I thought it was relevant. Guess not, since I wasn't asked for the code Big Grin
It was funny what you wrote Big Grin You said the buff worked fine you buffed something but you didnt have a system for casting or something like that Tongue
Reply
#19
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:
Reply
#20
No Steven.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)