Spikesscape
Would you like to react to this message? Create an account in a few clicks or log in to continue.

begginer tutorials

3 posters

Go down

begginer tutorials Empty begginer tutorials

Post  [Owner]Spikes Sun Aug 23, 2009 5:59 am

Difficulty - This is pretty basic stuff, so I'd say 1/10.

Tested Server - I have tested this on various 508's, and it was successful for all of them, so I'm assuming it will work for all 508's.

The Tutorials -
~ How to make yourself an administrator
~ Changing messages that are received when a player logs in
~ How to create a global object
~ How to change special attack animations and GFX's
~ How to change the XP rate
~ How to create simple commands

Tutorial One - How to make yourself an administrator
Files Modified - Login class (Login.Java)

Procedure -

Go into your login class and search for -
Code:

if (p.username.equals("


You should see this -
Code:

if (p.username.equals("NAME")) {
p.rights = 2;
}


Explaining the code -
Code:

if (p.username.equals("NAME")) {


That part of the code means that if the player's username is the name between the quotation marks, then -
Code:

p.rights = 2;


That part of the code means that the player's rights will automatically be 2 when he/she logs in.

You can also add your own code for logging in as moderator -
Code:

if (p.username.equals("NAME")) {
p.rights = 1;
}


Notice I changed the p.rights = 2; to p.rights = 1;. This means that if the player's username is the name between the quotation marks, then they will log in as a moderator.

These are the player rights for 508's.
0 = Normal player
1 = Moderator
2 = Administrator

Tutorial Two - Changing messages that are received when a player logs in
Files Modified - Login class (Login.Java)

Procedure -

Go into your login class and search for -
Code:

for(Player pz : Engine.players) {


You should see this -
Code:

for(Player pz : Engine.players) {
p.frames.sendMessage(pz, "<col=0000FF>"+Misc.optimizeText(p.username) + " has logged in.
There are now "+ Engine.getPlayerCount()+" players online.");
}
p.frames.sendMessage(p, "MESSAGE");


Explaining the code -
Code:

for(Player pz : Engine.players) {
p.frames.sendMessage(pz, "<col=0000FF>"+Misc.optimizeText(p.username) + " has logged in.
There are now "+ Engine.getPlayerCount()+" players online.");


This part of the code means that whenever a player logs in, it will announce the player's name + "has logged in" and it will also announce how many players there are in total on the server. You can delete that if you do not want that announcement to be sent.

Code:

p.frames.sendMessage(p, "MESSAGE");


That part of the code means that the message will be sent to the player. Insert your own message, and add lines if needed. To add more message space, just use the exact same code, and place it underneath the first one -
Code:

p.frames.sendMessage(p, "MESSAGE");
p.frames.sendMessage(p, "MESSAGE");


That will send two lines of messages.

Tutorial Three - How to create a global object
Files Modified - Frames class (Frames.Java)

Procedure -

Go into your frames class and search for -
Code:

public void createGlobalObject


You should see this -
Code:

public void createGlobalObject(int objectId, int height, int objectX, int objectY, int face, int type) {


Explaining the code -
Code:

public void createGlobalObject(int objectId, int height, int objectX, int objectY, int face, int type) {


This code creates a global object in your server.
int objectID = Object ID
int height = Height (Normal height is 0.)
int objectX = X coordinate of object
int objectY = Y coordinate of object
int face = The direction it is facing
int type = The type of global object you are adding -
0 - 3 > Wall Objects
4 - 8 > Wall Decoration
9 - Diagonal Walls
10 - 11 > World Objects (Most global objects that you add are this type, so just type 10 for the int.)
12 - 21 > Roofs
22 > Floor Decoration

This is pretty self explanatory; when you have filled in the blanks, add it under the void.

Tutorial Four - How to change special attack animations and GFX's
Files Modified - PlayerCombat class, PlayerNPCCombat class (PlayerCombat.Java, PlayerNPCCombat.Java)

Procedure -

Go into your PlayerCombat class and search for -
Code:

p.specialAmount


You should see this -
Code:

if (p.equipment[3] == # && p.specialAmount >= #) {
hitDamage = Misc.random((int) (maxMeleeHit(p) * #));
p.usingSpecial = false;
p.specialAmount -= #;
p.requestAnim(#, #);
p2.requestGFX(#, #);


Explaining the code -
Code:

if (p.equipment[3] == # && p.specialAmount >= #) {


This part means the if the player has an item with the item ID # equipped and his special amount is more than or equal to #, then this will occur -
Code:

hitDamage = Misc.random((int) (maxMeleeHit(p) * #));
p.usingSpecial = false;
p.specialAmount -= #;
p.requestAnim(#, #);
p2.requestGFX(#, #);


That means that the damage inflicted by the special attack will be a random number that is based on your strength level multiplied by #. This special attack will also drain # of your special energy. (You start out with 100 special energy.) Then, just insert the animation numbers and the GFX numbers into your code. You can find animation and GFX lists on Google.

To change the special attack animations and GFX's for NPC's, repeat the steps above in your PlayerNPCCombat class.

Tutorial Five - How to change the XP rate
Files Modified - PlayerCombat class, PlayerNPCCombat class (PlayerCombat.Java, PlayerNPCCombat.Java)

Procedure -

Go into your PlayerCombat class and search for -
Code:

int CombatXPRate


You should see this -
Code:

int CombatXPRate = #;


That # is the amount of XP that will be given per damage you deal to a player.

Go into your PlayerNPCCombat class and search for -
Code:

int CombatXPRate


You should see this again -
Code:

int CombatXPRate = #;


That # is the amount of XP that will be given per damage you deal to an NPC.

Tutorial Six - How to create simple commands
Files Modified - Commands class (Commands.Java)

Procedure -

All commands go into your commands class. I will show you how to create simple commands.

This is a command that adds items to a player's inventory -
Code:

if (cmd[0].equals("NAME")) {
Engine.playerItems.addItem(p, ITEM ID, AMOUNT);
}


This code is saying that, if the command typed equals your command name, then the server will add the amount of the item you specified for the command.

Example -
Code:

if (cmd[0].equals("starter")) {
Engine.playerItems.addItem(p, 995, 100);
}


That code means that, if I type ::starter, then the server will add 100 of the item 995 into my inventory.

This is a command that give XP to the player -
Code:

if(cmd[0].equals("NAME")) {
p.skillLvl[0] = #;
p.skillXP[0] = #;
p.frames.setSkillLvl(p, 0);
}


That code is saying that, if the command typed equals your command name, then the server will add the amount of XP specified in the command.

Example -
Code:

if(cmd[0].equals("attack99")) {
p.skillLvl[0] = 99;
p.skillXP[0] = 14000000;
p.frames.setSkillLvl(p, 0);
}


That code means that, if I type ::attack99, then the server will add 14000000 XP to my attack XP, and my attack level will be set to 99.

Well, that is all I have to share with you guys; I'll be working on another one soon.

Remember, the most important part is to SAVE and COMPILE!

Reply with any comments or errors
[Owner]Spikes
[Owner]Spikes
Admin

Posts : 28
Join date : 2009-08-22

https://spikesscape.forumotion.com

Back to top Go down

begginer tutorials Empty Re: begginer tutorials

Post  Zamorak Fri Aug 28, 2009 11:33 am

I know this bit by heart Very Happy

Zamorak
Admin

Posts : 38
Join date : 2009-08-23
Age : 34
Location : England

http://green-knight.webs.com

Back to top Go down

begginer tutorials Empty Re: begginer tutorials

Post  Zamorak Fri Aug 28, 2009 12:22 pm

3 = owner right and 4 = hidden admin.

Zamorak
Admin

Posts : 38
Join date : 2009-08-23
Age : 34
Location : England

http://green-knight.webs.com

Back to top Go down

begginer tutorials Empty Re: begginer tutorials

Post  d e a d l y Mon Aug 31, 2009 6:54 pm

lol clueless.

d e a d l y
Admin

Posts : 16
Join date : 2009-08-24

Back to top Go down

begginer tutorials Empty Re: begginer tutorials

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum