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.