-
[v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Hey guys! I've been messing around with multiple sources and finally settled with MapleCrystal 117.2 which is very well done but unfortunately there was a few complications.
After fixing most of the problems I had, I only have a few remaining
1: When i first installed the source, each class spawned on an empty map with a broken portal. Naturally that was really bad so I tried to change the start location per class in the LoginInformationProvider.java and noticed it did not work. It seems to only take the MapleCharacter.java "Save new char to db" (Line 1208) and applies all jobs to this map.
Now every single jobs spawn at the adventurer tutorial which is unfortunate because I would like all classes to spawn to lilth harbor except for adventurers and cygnus knights where they would retain their original location. (Their respective tutorials)
2: My second problem is the chests//boxes for Pio's chair or the Cygnus knight tutorial area only drop mesos. Are boxes an enemy? How are the loot handled? There's not much documentation about this and it's confusing me. I would assume any box related quests are also effected.
3: When leveling over your level before taking the class advancement I end up with WAYYY too many skill points. Does anyone know where this could be? Or why this happens? It seems to retain the amount of points you would have gained and apply them again upon job change
Level 13 Beginner turns to pirate. 1 point from job change, 9 points from beginner 3 levels. And then another 9 points are granted again.. Giving a total of 19 points upon job advance... This can be rather unfair in my opinion.
I managed to fix all my other issues such as shop not working, Quests errors, job advance errors, change exp to below 1x rate into 0.5x (Stupid integers grrr!) and other things like that.. So i'm not completely useless.. Help would be greatly appreciated <3
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Im not 100% sure about 1, but i guess you could do a simple check for job.
As for the rest:
2. Boxes are reactors, you can script them and they have their own table of drops in the database.
3. Many sources have this. Simplest solution is to do a calculation of the SP you would have if you job advanced in time, when you job advance, and set the SP to that value.
Hope this help ;)
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
oh wow you fixed my problem #2 , Ill have to study more about java for 1 and 3.. I'm still at a semi script kiddie semi coder level in java
- - - Updated - - -
@Novak Is there any sort of Pokedex that tells us which script or which WZ file is what? IE monsters or reactors? It's like finding a needle in a haystack. I found the tutorial box because it was the first two id's but not the eerve one
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Quote:
Originally Posted by
Kittyjessika
oh wow you fixed my problem
#2 , Ill have to study more about java for 1 and 3.. I'm still at a semi script kiddie semi coder level in java
- - - Updated - - -
@
Novak Is there any sort of Pokedex that tells us which script or which WZ file is what? IE monsters or reactors? It's like finding a needle in a haystack. I found the tutorial box because it was the first two id's but not the eerve one
No idea, i never actually worked on any reactors :p And a quick google didn't give me the answer either xD
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
1 is easy, like novak said just do a check. if c.getPlayer().getJobId() == id of the job { startermap = blabla}
something like that would probably work.
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Yeah, you can prolly do:
Code:
if c.getPlayer().getJobId() == id {ps.setInt(mapID)} else {ps.setInt(mapID)}
And put that over the ps.setInt that handles the startermap now.
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Quote:
Originally Posted by
Novak
Yeah, you can prolly do:
Code:
if c.getPlayer().getJobId() == id {ps.setInt(mapID)} else {ps.setInt(mapID)}
And put that over the ps.setInt that handles the startermap now.
since its already in mapelcharacter it might just be getJobId() insead of c.getPlayer().getJobId()
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Code:
//this code sets playerspawn //BEGINNER
if (chr.getPlayer().getJobId() == 0) { //first class check
ps.setInt(18, 000000000); //set location
}else{ //try again
//NOBLESSE
if (chr.getPlayer().getJobId() == 1000) { //check for second class
ps.setInt(18, 000000000); //set location
}else{ //try again
//CITIZEN
if (chr.getPlayer().getJobId() == 3000) { //check third class
ps.setInt(18, 000000000); //set location
}else{ //try again
//MIHILE_0
if (chr.getPlayer().getJobId() == 5000) { //check for fourth class
ps.setInt(18, 000000000); //set location
}else{ //try again
ps.setInt(18, 000000000); //ran out of if statements so we default to this location
}
Why doesn't this compile? Apparently it messes up with SQL and give me 100 errors..
I looked in AbstractPlayerInteraction and it seems everything is fine there..
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Quote:
Originally Posted by
Kittyjessika
Code:
//this code sets playerspawn //BEGINNER
if (chr.getPlayer().getJobId() == 0) { //first class check
ps.setInt(18, 000000000); //set location
}else{ //try again
//NOBLESSE
if (chr.getPlayer().getJobId() == 1000) { //check for second class
ps.setInt(18, 000000000); //set location
}else{ //try again
//CITIZEN
if (chr.getPlayer().getJobId() == 3000) { //check third class
ps.setInt(18, 000000000); //set location
}else{ //try again
//MIHILE_0
if (chr.getPlayer().getJobId() == 5000) { //check for fourth class
ps.setInt(18, 000000000); //set location
}else{ //try again
ps.setInt(18, 000000000); //ran out of if statements so we default to this location
}
Why doesn't this compile? Apparently it messes up with SQL and give me 100 errors..
I looked in AbstractPlayerInteraction and it seems everything is fine there..
You did:
Code:
}}else{ //try again
//NOBLESSE
if (chr.getPlayer().getJobId() == 1000) { //check for second class
ps.setInt(18, 000000000); //set location
}else{ //try again
//CITIZEN
if (chr.getPlayer().getJobId() == 3000) { //check third class
ps.setInt(18, 000000000);
You should do:
Code:
else if (chr.getPlayer().getJobId() == 1000) { //check for second class
ps.setInt(18, 000000000); //set location
}else if (chr.getPlayer().getJobId() == 3000) { //check third class
ps.setInt(18, 000000000);
You can't just make multiple else statements. Just follow this: 1 x if{: First check, infinite }else if{ (check for a different value) and 1. }else{ at the end (what to do when all other checks return false)
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
This is ugly and disgusting but it compiled.
if (chr.job == 0) { //check what job
ps.setInt(18,000000000); //since the job id was 0 we use adventurer start
} else { //id wasnt 0 gotta try again
if (chr.job == 1000) { //check what job
ps.setInt(18,130030000); //since the job id was 1000 we use the Cygnus start
} else {
if (chr.job == 3000) { //check what job
ps.setInt(18,931000000); //since the job id was 3000 we use the resistance spawn
} else {
ps.setInt(18,931030000); //default zone is the shitbox since we ran out of jobs
}
}
}
This is what it took to make it work. :)
#1 fixed
#2 minor problems still probably wz files
#3 about to get started on it.
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Quote:
Originally Posted by
Kittyjessika
This is ugly and disgusting but it compiled.
if (chr.job == 0) { //check what job
ps.setInt(18,000000000); //since the job id was 0 we use adventurer start
} else { //id wasnt 0 gotta try again
if (chr.job == 1000) { //check what job
ps.setInt(18,130030000); //since the job id was 1000 we use the Cygnus start
} else {
if (chr.job == 3000) { //check what job
ps.setInt(18,931000000); //since the job id was 3000 we use the resistance spawn
} else {
ps.setInt(18,931030000); //default zone is the shitbox since we ran out of jobs
}
}
}
This is what it took to make it work. :)
#1 fixed
#2 minor problems still probably wz files
#3 about to get started on it.
And still you should do what @Novak said, cause this is really bad :p
Might even want to use cases
Code:
Switch(chr.job) {
Case 0:
ps.setInt(blabla);
break;
Case 100:
ps.setInt(whatever u want);
Break;
Default:
Ps.setInt(default map)
Break;
}
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
So i've been looking into the too many skill points problem.. Something has been confusing me.. is there multiple kind of skill points? It seems some can only be placed on 1st job and so on.. To fix the issue I wanted to apply the logic where you take the level of your character, substract 10 - or 30 or whatever to it depending on which job advance you are at, multiply that value by 3 and add that many "Negative" skill points. Which would fix the issue. Sadly I do not understand at all how the skillpoint system works for each other jobs. Anyone know about this?
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
I think they are all stored by job. But classes like evan have like 8 jobs, making it really long.
Its generally stored as: 1stjobsp, 2ndjobsp, 3rdjobsp, ... and so on
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
You guys ever heard about Ternary?
Quote:
ps.SetInt((chr.getPlayer().getJobId() == JOB_ID) ? ifTrueMapID : ifFalseMapID);
[Dont use it for too many checks or it will get very inefficient.]
And you could do like:
Quote:
int jobType = jobID / 1000;
if (jobType == 1) {
//do things
} else if (jobType == 2) {
//do other things
}
to shorten your code. Good luck!
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
I believe for the boxes/reactors you can add drops in the same way you add in drops for a mob.
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Thanks for all the help everyone, I seemed to have fix everything but the job SP... I'm lacking the java knowledge to be able to fix the issue. I have a general idea of what I want to do but I can't seem to make it work, I simply break everything.
I was thinking, Is there a way to edit the npc scripts so you gain a negative amount of SP when you complete the quest?
- - - Updated - - -
Code:
var missedLevels = cm.getPlayerStat("LVL") - 10;
var skilldistribution = missedLevels * -3;
cm.addSp(skilldistribution);
So i tried to add that on dances with balrog 1022000,js and it doesn't seem to work.
It says it doesn't know what to do with cm.addSp(skilldistribution);
edit2: cm.addSp("skilldistribution"); doesn;t work either
edit3: it seems that addSP is not a valid function... Then.. I'm clueless what is. Further studies must be made!
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Quote:
Originally Posted by
Kittyjessika
Thanks for all the help everyone, I seemed to have fix everything but the job SP... I'm lacking the java knowledge to be able to fix the issue. I have a general idea of what I want to do but I can't seem to make it work, I simply break everything.
I was thinking, Is there a way to edit the npc scripts so you gain a negative amount of SP when you complete the quest?
- - - Updated - - -
Code:
var missedLevels = cm.getPlayerStat("LVL") - 10;
var skilldistribution = missedLevels * -3;
cm.addSp(skilldistribution);
So i tried to add that on dances with balrog 1022000,js and it doesn't seem to work.
It says it doesn't know what to do with cm.addSp(skilldistribution);
edit2: cm.addSp("skilldistribution"); doesn;t work either
edit3: it seems that addSP is not a valid function... Then.. I'm clueless what is. Further studies must be made!
it's not a function in NPCConversationManager or w/e that class is called. Here's what you need to do :
Add :
Code:
cm.getChar().gainSp(skilldistribution);
to wherever you want to add it.
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Quote:
Originally Posted by
Spyboy9932
it's not a function in NPCConversationManager or w/e that class is called. Here's what you need to do :
Add :
Code:
cm.getChar().gainSp(skilldistribution);
to wherever you want to add it.
I get what you're saying that the addSp is not part of it. I went to lookup in NPCConversationManager and it did not seem to have gainSp either. It did have gainAp tho. It seems like I would need to add a gainSp into it right?
It does not seem to work when I add it into the conversation manager as gainSp is not part of the code anywhere either. It seems I need to find the name of the function that adds skill points. Anyone knows how it's called by any chance?
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Please try writing in this way.
Code:
cm.getPlayer().gainSP(skilldistributtion);
You can use if there is a gainSP() routine in 'client/MapleCharacter.java' .
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
your sp gain formula should take that into consideration.
no java knowledge is needed here, only math.
you gave the example of a pirate 1st job advancement, so let's use it.
normally, you should be advancing at level 10, gaining 1 SP. if you overlevel, you gain 1 + 3 x level SP.
so your formula should look like:
setSp(1 + (chr.getLevel() - 10) * 3);
2 things to note about this:
1. you reduce 10 from your level, because those levels did not reward any sp for that job.
2. I simply overwrite the sp, instead of adding to the current amount. if you overwrite with a correct formula, you can never get it wrong
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Quote:
Originally Posted by
namazi
Please try writing in this way.
Code:
cm.getPlayer().gainSP(skilldistributtion);
You can use if there is a gainSP() routine in 'client/MapleCharacter.java' .
There is one but I get this..
http://i.gyazo.com/fad381560b18f9052c3c5f2ee477f245.png
Edit:
Why do I have 2 gainSp?
PHP Code:
public void gainSP(int sp)
{
this.remainingSp[GameConstants.getSkillBook(job)] += sp; //default
updateSingleStat(MapleStat.AVAILABLESP, 0); // we don't care the value here
client.getSession().write(InfoPacket.getSPMsg((byte) sp, (short) job));
}
public void gainSP(int sp, final int skillbook)
{
this.remainingSp[skillbook] += sp; //default
updateSingleStat(MapleStat.AVAILABLESP, 0); // we don't care the value here
client.getSession().write(InfoPacket.getSPMsg((byte) sp, (short) 0));}
- - - Updated - - -
Quote:
Originally Posted by
Saii
your sp gain formula should take that into consideration.
no java knowledge is needed here, only math.
you gave the example of a pirate 1st job advancement, so let's use it.
normally, you should be advancing at level 10, gaining 1 SP. if you overlevel, you gain 1 + 3 x level SP.
so your formula should look like:
setSp(1 + (chr.getLevel() - 10) * 3);
2 things to note about this:
1. you reduce 10 from your level, because those levels did not reward any sp for that job.
2. I simply overwrite the sp, instead of adding to the current amount. if you overwrite with a correct formula, you can never get it wrong
PHP Code:
if (cm.getJob() == 0) {
cm.resetStats(35, 4, 4, 4);
cm.expandInventory(1, 4);
cm.expandInventory(4, 4);
cm.changeJob(100); // WARRIOR
var missedLevels = cm.getPlayerStat("LVL") - 10;
var skilldistribution = missedLevels * 3;
cm.getPlayer().setRemainingSp(skilldistribution +1);
cm.dispose();
The good news is this works properly. The bad news is that if you're level 11, it draws 7 points in the skill box and properly adjusts to 3 the moment you spend one point.
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Quote:
Originally Posted by
Kittyjessika
Why do I have 2 gainSp?
PHP Code:
public void gainSP(int sp)
{
this.remainingSp[GameConstants.getSkillBook(job)] += sp; //default
updateSingleStat(MapleStat.AVAILABLESP, 0); // we don't care the value here
client.getSession().write(InfoPacket.getSPMsg((byte) sp, (short) job));
}
public void gainSP(int sp, final int skillbook)
{
this.remainingSp[skillbook] += sp; //default
updateSingleStat(MapleStat.AVAILABLESP, 0); // we don't care the value here
client.getSession().write(InfoPacket.getSPMsg((byte) sp, (short) 0));}
- - - Updated - - -
Look at the parameters required and you'd understand why... hopefully. The second one is complete useless.
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
I mean, wouldn't that create a conflict?
-
Re: [v117.2] Three problems on maplecrystal.. Shouldn't be too complex to fix
Quote:
Originally Posted by
Kittyjessika
There is one but I get this..
http://i.gyazo.com/fad381560b18f9052c3c5f2ee477f245.png
Edit:
Why do I have 2 gainSp?
PHP Code:
public void gainSP(int sp)
{
this.remainingSp[GameConstants.getSkillBook(job)] += sp; //default
updateSingleStat(MapleStat.AVAILABLESP, 0); // we don't care the value here
client.getSession().write(InfoPacket.getSPMsg((byte) sp, (short) job));
}
public void gainSP(int sp, final int skillbook)
{
this.remainingSp[skillbook] += sp; //default
updateSingleStat(MapleStat.AVAILABLESP, 0); // we don't care the value here
client.getSession().write(InfoPacket.getSPMsg((byte) sp, (short) 0));}
- - - Updated - - -
PHP Code:
if (cm.getJob() == 0) {
cm.resetStats(35, 4, 4, 4);
cm.expandInventory(1, 4);
cm.expandInventory(4, 4);
cm.changeJob(100); // WARRIOR
var missedLevels = cm.getPlayerStat("LVL") - 10;
var skilldistribution = missedLevels * 3;
cm.getPlayer().setRemainingSp(skilldistribution +1);
cm.dispose();
The good news is this works properly. The bad news is that if you're level 11, it draws 7 points in the skill box and properly adjusts to 3 the moment you spend one point.
if I understood you correctly, this is because you didn't add the SP update packet in your setSP method.