- Joined
- Feb 22, 2009
- Messages
- 112
- Reaction score
- 2
I had a thread here once about this, I thought i fixed my problem. But i further tested and i did not. In ourstory v142 4th job skills are locked there mastery levels are set to 0. I created a work around where when you change jobs it calls the method changeSingleSkillLevel() and that is used in the MaxSkillsByJob function. I used that method and took out the part that maxed skills and left the mastery part in there. Example of my method,
This did the trick 4th job skills get the mastery and skills arent maxed, although each time you change jobs you get a bit of lag but whatever it worked. Problem is, it resets all the skill levels to 0, so say you had your 1st,2nd,3rd job skills all maxed out, when you get your fourth job your prior job skills are all level 0 again... Now i cant see why since the skill level part of the method is removed.. This is the method i call when changing jobs.
With this i noticed its calling all skills, i saw theres a method in skillfactory.java like the same as getAllSkills but called getSkillsByJob(). Thought i could do that and just list the job ids i want to max and it wouldnt reset the skills in prior jobs. But i cant seem to convert it, i cant work past the errors. Does anyone have a solution to this problem? It would be greatly appreciated, id love to further my learning. Very sorry for the huge wall of text here!
PHP:
public void changeSingleSkillLevel1(Skill skill, byte newMasterlevel, long expiration) {
Map list = new HashMap();
boolean hasRecovery = false;
boolean recalculate = false;
if (changeSkillData1(skill, newMasterlevel, expiration)) {
list.put(skill, new SkillEntry(newMasterlevel, expiration));
if (GameConstants.isRecoveryIncSkill(skill.getId())) {
hasRecovery = true;
}
//if (skill.getId() < 80000000) {
//recalculate = true;
// }
}
if (list.isEmpty()) {
return;
}
this.client.getSession().write(CWvsContext.updateSkills(list));
reUpdateStat(hasRecovery, recalculate);
}
PHP:
public final void maxMastery() {
for (Skill skil : SkillFactory.getAllSkills()) {
if (GameConstants.isApplicableSkill(skil.getId()) && skil.canBeLearnedBy(getJob()) && GameConstants.canuseskill(skil.getId())) { //no db/additionals/resistance skills
// if (GameConstants.isApplicableSkill(skil.getId()) && skil.canBeLearnedBy(getJob())) {
changeSingleSkillLevel1(SkillFactory.getSkill(skil.getId()), (byte) skil.getMaxLevel(), -1);
}
}
}

