Junior Spellweaver
- Joined
- Apr 13, 2011
- Messages
- 119
- Reaction score
- 11
I was bored so I decided to share my noob knowledge with RZ. This is a tutorial on how to do basic things on the java files.
I'm not sure how to start with this, so I guess I'll just blab on to see what fits lol.
Example: MapleCharacter.java -> ctrl + F -> levelUp
The code below is part of the levelUp function from MoopleDev rev 107 (v83) First, in order to do anything you have to know how to understand what the code says. I'm not 100% perfect at doing this as I am a noob, but basically what this says is:
when players level up, if they are beginners, and below level 6 they will gain 5 str each time they level. If they are over level 6, they will gain 4 str and 1 dex each time. If they are cygnus knights and are under level 70, they will gain the "remainingap" which is 5 in this case.
Now that you know what it says, let's change it up a bit. Since this is the whole levelup function, it lets you add in things it should do as the player levels up. For example, if you wanted to add mini leveling occupations, you would do something like:
I've added something at the bottom saying if the player levels up and they are level 10, it will give them five fame and show them a message saying that they reached level 10 and they recieved 5 fame. If you wanted to do something like teleport them to another map or something you'd change the gainFame(5); to something like changeMap(id); or something like that. It's very simple as long as you know how to understand what the scripts do and you know what they SHOULD do. It's mostly common sense. Most of the functions you need are in MapleCharacter.java so you can look off of that. Use NetBeans to help you.
Well... This is mostly common sense so I have no idea what else I should do. I feel like if i go on anymore, I'm gonna either be cliche or expose the ideas that I have for my server by using them as examples so I'm going to cut the "tutorial" off there. I know it didn't help much, but uhh yeah lol. Idk. Sorry for the sucky tutorial? Anyways good luck (Y)
I'm not sure how to start with this, so I guess I'll just blab on to see what fits lol.
Example: MapleCharacter.java -> ctrl + F -> levelUp
The code below is part of the levelUp function from MoopleDev rev 107 (v83) First, in order to do anything you have to know how to understand what the code says. I'm not 100% perfect at doing this as I am a noob, but basically what this says is:
when players level up, if they are beginners, and below level 6 they will gain 5 str each time they level. If they are over level 6, they will gain 4 str and 1 dex each time. If they are cygnus knights and are under level 70, they will gain the "remainingap" which is 5 in this case.
Code:
public void levelUp(boolean takeexp) {
ISkill improvingMaxHP = null;
ISkill improvingMaxMP = null;
int improvingMaxHPLevel = 0;
int improvingMaxMPLevel = 0;
if (isBeginnerJob()) {
remainingAp = 0;
if (getLevel() < 6) {
str += 5;
} else {
str += 4;
dex += 1;
}
} else {
remainingAp += 5;
if (isCygnus() && level < 70) {
remainingAp++;
}
}
Now that you know what it says, let's change it up a bit. Since this is the whole levelup function, it lets you add in things it should do as the player levels up. For example, if you wanted to add mini leveling occupations, you would do something like:
Code:
public void levelUp(boolean takeexp) {
ISkill improvingMaxHP = null;
ISkill improvingMaxMP = null;
int improvingMaxHPLevel = 0;
int improvingMaxMPLevel = 0;
if (isBeginnerJob()) {
remainingAp = 0;
if (getLevel() < 6) {
str += 5;
} else {
str += 4;
dex += 1;
}
} else {
remainingAp += 5;
if (isCygnus() && level < 70) {
remainingAp++;
}
}
if (getlevel() == 10) {
dropMessage("Good job, you reached level 10! You get 5 fame as your prize!");
gainFame(5);
}
I've added something at the bottom saying if the player levels up and they are level 10, it will give them five fame and show them a message saying that they reached level 10 and they recieved 5 fame. If you wanted to do something like teleport them to another map or something you'd change the gainFame(5); to something like changeMap(id); or something like that. It's very simple as long as you know how to understand what the scripts do and you know what they SHOULD do. It's mostly common sense. Most of the functions you need are in MapleCharacter.java so you can look off of that. Use NetBeans to help you.
Well... This is mostly common sense so I have no idea what else I should do. I feel like if i go on anymore, I'm gonna either be cliche or expose the ideas that I have for my server by using them as examples so I'm going to cut the "tutorial" off there. I know it didn't help much, but uhh yeah lol. Idk. Sorry for the sucky tutorial? Anyways good luck (Y)
Last edited: