Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
lol
#1
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


Forum Jump:


Users browsing this thread: 1 Guest(s)